ofType
A matcher to nail down your handler to a specific set of actions
import { ofType } from 'redux-fluent';
ofType(...types);
Arguments
- variadic
string | { type: string } | { toString(): string }
- the action types
Returns
({
map: (handler) => Reducer,
})
Usage
Applies the mapFn
if the given action matches with the expected types.
ofType('foo', 'bar', baz).map(mapFn)
- applies
mapFn
ifaction.type
is eitherfoo
,bar
orbaz.type | baz.toString()