fetch-middleware icon indicating copy to clipboard operation
fetch-middleware copied to clipboard

Actions chained to prevent unexpected behavior

Open MathMesquita opened this issue 7 years ago • 4 comments

All actions are now composed on a promise chain.

MathMesquita avatar Apr 15 '17 17:04 MathMesquita

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

arojunior avatar Apr 18 '17 11:04 arojunior

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 )

MathMesquita avatar Apr 18 '17 14:04 MathMesquita

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?

arojunior avatar Apr 20 '17 21:04 arojunior

Hi @arojunior, i'm going to take a look at it and post here a possible solution !

MathMesquita avatar May 03 '17 14:05 MathMesquita