You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to add support for dispatching thunks to our logux store on the client side. My approach has been to use redux-thunk-fsa so that all thunks have a type and the callback is passed as the payload. However in order for my components to access the results of the executed thunks requires returning the result of the dispatch operation.
Here is the diff that solved my problem:
diff --git a/node_modules/@logux/redux/create-store-creator/index.js b/node_modules/@logux/redux/create-store-creator/index.js
index 2d77ee5..b97b2cd 100644
--- a/node_modules/@logux/redux/create-store-creator/index.js+++ b/node_modules/@logux/redux/create-store-creator/index.js@@ -64,9 +64,10 @@ export function createStoreCreator(client, options = {}) {
prevMeta = meta
let prevState = store.getState()
- originDispatch(action)+ let result = originDispatch(action)
emitter.emit('change', store.getState(), prevState, action, meta)
saveHistory(meta)
+ return result
}
store.dispatch.local = (action, meta = {}) => {
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
@logux/[email protected]
for the project I'm working on.I'm trying to add support for dispatching thunks to our logux store on the client side. My approach has been to use
redux-thunk-fsa
so that all thunks have atype
and the callback is passed as thepayload
. However in order for my components to access the results of the executed thunks requires returning the result of the dispatch operation.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: