redux-logic
redux-logic copied to clipboard
createLogic type can be string array
I noticed that the editor complained about the type not being correct for passing an array of types. According to documentation it is: required string, regex, Symbol, array of str/regex/Symbol, use '*' for all
logic.prototype = {
persistEffect: createLogic({
type: [
events.ADD_TODO,
events.DELETE_TODO,
events.EDIT_TODO,
events.COMPLETE_TODO,
events.COMPLETE_ALL_TODOS,
events.CLEAR_COMPLETED
],
process({actions, action}, dispatch, done) {
console.log(`Intercept TODO ${action.type}`);
dispatch(actions.persistTodo(action));
done();
}
})
Adding Array
export type PrimitiveType<Type extends string | symbol, InputPayload> =
| Type
| RegExp
| Array<string>
| Function;
Using Windows 10, Node 12.20, redux 4.0.5, redux-logic 3.0.2, rxjs 6.6.3
Thank you for the awesome library btw!