fetch-middleware
fetch-middleware copied to clipboard
Actions chained to prevent unexpected behavior
All actions are now composed on a promise chain.
Nice Job, Dude. Thanks for your contribuition! But this code didn't pass in my tests. It is actually not working. Can you review?
By the way, I just created another branch with check promise funcionality, take a look: https://github.com/arojunior/fetch-middleware/compare/check-promise
Sorry about that, i fixed and improved the code, my tests passed.
By the way, if the user passes any data to payload
that is not a function which returns a Promise
, it will still work but nothing will be passed to success
action. ( #2 )
Ok, now it's working perfectly... But it's not compatible with 'check-promise' branch.
By the way, if the user passes any data to payload that is not a function which returns a Promise , it will still work but nothing will be passed to success action.
How can we improve it to do not discard any functionality?
Hi @arojunior, i'm going to take a look at it and post here a possible solution !