rt2zz / redux-action-buffer

Buffer Redux Actions
MIT License
79 stars 6 forks source link

redux-action-buffer before thunk middleware #6

Open qntnrbns opened 7 years ago

qntnrbns commented 7 years ago

In your documentation, you suggest that the user place the middleware returned createActionBuffer after the thunk middleware. Your code does not actually necessitate this, and there are use cases where you may want to delay thunks before state is loaded: for example, if you need data from the stored state to make a network request.

rt2zz commented 7 years ago

that is a good point. IIRC there was some confusion because code often depends on the return values of thunks, which action buffer destroys. I think the next version should actually return promises that resolve to the original value. Still it is I think a risky paradigm because it introduces uncertainty about how thunks work.

qntnrbns commented 7 years ago

True, that is a good suggestion for an update. I could take that on in the near future if you want.