Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

can't use redux-thunk's withExtraArgument mechanism with @stencil/redux #17

Open
ntregillus opened this issue Mar 1, 2019 · 1 comment

Comments

@ntregillus
Copy link

Since @stencil/redux has the peer dependency, I expectd that I could use redux middle where Thunk.

However, the MapDispatchToProps method is not handling the middleware's ability to inject another parameter into the delegate.

for example. normal delegate actions looks like:

export function executeAction() {
  return (dispatch, getStore) {
   dispatch({type: MY_ACTION, ...});
  };
}

and Thunk describes a feature withExtraArgument which should allow me to include my API Client the same way the getStore and dispatch actions are provided:

export function executeAction() {
  return (dispatch, getStore, apiClient) {
   dispatch({type: MY_ACTION, ...});
  };
}

However the Stencil code is ignoring this middleware.... I was wondering why this doesn't work....

@ntregillus
Copy link
Author

Note: I was able to work around this by adding another reducer to my state to provide the client via the getState() endpoint

@ntregillus ntregillus changed the title redux-thunk withExtraArgument does not work can't use redux-thunk's withExtraArgument mechanism with @stencil/redux Mar 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant