unistore
unistore copied to clipboard
Add thunk-like action
I guess this would just be actions that invoke a callback to signify completion rather than returning a promise?
Yup
I'm on the fence about this one. I wonder if what we really need is middleware... Right now I'm not sure how we'd be able to support thunks since we already use returned functions as a way to detect promisified actions. Any thoughts on a way to do it? If we could find a solution, the plumbing should be literally just another line here.
unistore
can support this out of the box if it has middleware
support or something like that.
@developit I want to help but I don't know what's on your mind. I can only picture this with an event driven architecture, as far as I can see, unistore
is not event driven since we literally fire the actions which are functions instead of firing an event.
@aprilmintacpineda I looked at how redux
applies middleware cuz it's nicely documented. I have a proof of concept for generic middleware support in unistore
running locally, and will put up a fork soon that hopefully doesn't add too many bytes!
Hey all, check out #109 for a really basic support for thunks. 🤷♂️