By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,374 Members | 1,768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,374 IT Pros & Developers. It's quick & easy.

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

P: 4
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:

Expand|Select|Wrap|Line Numbers
  1. offline(...offlineConfig, {
  2.        effect: (effect, action) => {
  3.          console.log("Executing effect");
  4.        }
  5. }
The control comes to the above code after executing the code below(as expected):

Expand|Select|Wrap|Line Numbers
  1. meta: {
  2.    offline: {
  3.       effect: { url: 'xyz',method: 'POST', body:content },
  4.       commit: {..},
  5.       rollback: {...}
  6.    }
  7. }
It then throws an error: Cannot read property 'then' of undefined at line:

Expand|Select|Wrap|Line Numbers
  1. return config.effect(metadata.effect, action).then(function (result) {
  2.  
The code works fine if i remove the configuration for effect. Any help?
Oct 6 '17 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.