-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Hi! π
Firstly, thanks for your work on this project! π
Today I used patch-package to patch @logux/redux@0.8.1 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 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 = {}) => {This issue body was partially generated by patch-package.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels