redux-action-buffer icon indicating copy to clipboard operation
redux-action-buffer copied to clipboard

redux-action-buffer before thunk middleware

Open qntnrbns opened this issue 9 years ago • 2 comments

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.

qntnrbns avatar Jan 26 '17 22:01 qntnrbns

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.

rt2zz avatar Feb 03 '17 10:02 rt2zz

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

qntnrbns avatar Feb 03 '17 17:02 qntnrbns