FredericHeem / redux-act-async

Reduce boilerplate for redux async actions and reducers
Apache License 2.0
125 stars 22 forks source link

Added dispatch to api call to be able to dispatch a new action within… #6

Closed brianrcoyle closed 8 years ago

brianrcoyle commented 8 years ago

… async functions

FredericHeem commented 8 years ago

Thanks for the contribution. In order to make it more generic, createActionAsync has been modified so that the api function being called can accept any number of parameters. Do you mind to give a try ?

brianrcoyle commented 8 years ago

I tried 0.5.0, but that doesn't seem to fix my issue. I'm trying to be able to use dispatch inside my api function. The fix would just involve changing line 14 in createActionAsync to

return api(...args, dispatch)