-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to inject a custom argument into Epics #19
Comments
Examplesin redux-thunk: https://github.com/gaearon/redux-thunk#injecting-a-custom-argument in redux-observable: https://redux-observable.js.org/docs/recipes/InjectingDependenciesIntoEpics.html |
@jshthornton We should think about this also when considering the |
@joshburgess Wow, I was just putting together an example to go with a proposal to add this, and I see It's already here! Looking at the implementation of thunks and redux-observables, this seems fairly easy to add, would you be able to elaborate as to why it's a breaking change? |
Hi, @mcky I marked it as a breaking change, because it directly affects the Epic API, and we've been talking about possibly rearranging the order of arguments. Right now, as of the the last major update, there are two ways to use redux-most. See this section taken from the docs:
So, we have both of those, and, I'm still considering reversing the argument order on each of them, or evolving the API so that there is only ever one type of Epic and you can modify which extra arguments (other than the action$) you need through higher order functions. But I haven't narrowed down what the right course of action is yet, so I held off on adding this injecting dependencies feature, since I'm not sure the best way to make it fit in. It is, indeed, a pretty trivial thing to implement, but I'm still unsure about it in the context of changing argument orders, maybe using HOFs, etc.... See #4 for more info on reversing the argument order & HOFs ideas. Any ideas? |
Raised in issue joshburgess#19 but dismissed in favour of a more elegant HOF approach, after four months with no project activity, I've gone for the zero-impact pragmatic solution
Possible Feature: Add the ability to inject a custom argument into Epics
Consider adding the ability to inject a custom argument into Epics to give access to an API utility or similar dependency, like currently possible with redux-thunk and redux-observable.
We will need to consider how we handle #4 when implementing this.
The text was updated successfully, but these errors were encountered: