redux-injectors icon indicating copy to clipboard operation
redux-injectors copied to clipboard

incorrect typing for function `createManager` ?

Open mrfratello opened this issue 3 years ago • 1 comments

According to the source code of createManager, we can not pass reducer and saga in the parameter options:

    const isReducerInjected = reducer // <-- check
      ? useInjectReducer({ key, reducer })
      : true;

    const isSagaInjected = saga // <-- check
      ? useInjectSaga({ key, saga }) 
      : true;

But in typing, these properties are required:

export function createManager(options: { name: string, key: string, saga: Saga, /* <- required */ reducer: Reducer  /* <- required */  }): ...;

What is the mistake? in typing or implementation?

mrfratello avatar Jul 05 '22 15:07 mrfratello

Hey @mrfratello , this is a mistake with the typings. They should be optional. I see you made a PR, let me check it out

BenLorantfy avatar Jul 06 '22 04:07 BenLorantfy

Fixed in 2.1.0

BenLorantfy avatar Nov 22 '22 13:11 BenLorantfy