Skip to content

createLogic type can be string array #176

Open
@gregbown

Description

@gregbown

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 in logic.d.ts, this corrects it.

    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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions