Open vesparny opened 8 years ago
Sorry, finally got around to having a proper look at this. It looks like a pretty straightforward change. Would you like to submit a PR with tests for this?
Just want to say that this feature helps with integrating redial with something like https://github.com/jeffbski/redux-logic - thanks for sharing, @vesparny!
I'm not using Promises for http requests in my project, basically because I want to have the chance to cancel ongoing requests, so I tweaked redial making it able to support plain old callbacks.
In my fork you can see what I changed (please note it's just a prototype) https://github.com/vesparny/redial/blob/cb/src/trigger.js
That change allows hooks like:
dispatching a thunk, that invokes the callback when data has been loaded.
The implementation allows me to use
superagent
rather than other http clients Promise based.I'm not sure this is something worth considering,but it's working pretty well for me and I wanted to share with you to get your feedback.
Thanks