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
isOfType could accept an array of actions instead of one #85
Comments
Any reason you don't use |
Hey @paszkowskiDamian, thanks for the proposal. I agree and will integrate this change into the API. Our test suite will also need to be extended with new API cases. |
I've opened a new PR #86 implementing new API |
@Carl-Foster actaully, I didn't try with action$.pipe(
filter(isActionOf([fetchMoreAccountsFailed, fetchAccountsListFailed])),
mergeMap(async action /*inferes as RootAction*/ => accountsRepository.doSth(action.paylod)), |
@issuehuntfest has funded $20.00 to this issue. See it on IssueHunt |
@paszkowskiDamian has submitted a pull request. See it on IssueHunt |
It is PR implementing new API proposed in issue #85. API of `isOfType` has been extended to accept also an array of types as `redux-observable` operator `ofType`. It does not introduce any baking changes. * [x] Rebase before creating a PR to keep commit history clean * [x] Clear node_modules and reinstall all the dependencies: `npm run reinstall` * [x] Run checker npm script: `npm run check` Extra checklist: * [x] Always add some description and refer to all the related issues using `#` tag For bugfixes: * [ ] Add at least one unit test to cover the bug that have been fixed For new feature: * [x] Update API docs * [x] Add examples to demonstrate new feature * [x] Add type unit tests * [x] Add runtime unit tests
@piotrwitek has rewarded $14.00 to @paszkowskiDamian. See it on IssueHunt
|
Resolved by #86 |
Is your feature request related to a problem?
Sometimes we have epics that listen for more than one action. It would be really cool if could preserve type-safety of
isOfType
while being able to filter more than one action.Describe a solution you'd like
Who does this impact? Who is this for?
It is for TypeScript users who would like to handle multiple actions using one epic.
Describe alternatives you've considered
We could use
ofType
operator fromredux-observable
but it doesn't return proper types.Additional context
This is my local implementaion:
This could be integrated to already existing
ifOsType
.The text was updated successfully, but these errors were encountered: