unable to use custom configuration for effect for the plugin redux-offline

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gizmo
    New Member
    • Jul 2020
    • 1

    unable to use custom configuration for effect for the plugin redux-offline

    I am making use of the redux-offline plugin for offline first react-redux app. It works fine but I am facing issues with configuration.

    I tried the code:
    Code:
    offline(...offlineConfig, {
           effect: (effect, action) => {
             console.log("Executing effect");
           }
    }
    The control comes to the above code after executing the code below(as expected):
    Code:
    meta: {
       offline: {
          effect: { url: 'xyz',method: 'POST', body:content },
          commit: {..},
          rollback: {...}
       }
    }
    It then throws an error: Cannot read property 'then' of undefined at line:
    Code:
    return config.effect(metadata.effect, action).then(function (result) {
    The code works fine if i remove the configuration for effect. Any help?
Working...