platform icon indicating copy to clipboard operation
platform copied to clipboard

Redux Devtools angular 8

Open justintim-es opened this issue 6 years ago • 1 comments

Im trying to configure the redux devtools in app.module the way is used to configure it, but now i get an intellesense error.

Type 'StoreEnhancer<any, {}>[]' is not assignable to type 'Middleware<{}, any, Dispatch<AnyAction>>'. Type 'StoreEnhancer<any, {}>[]' provides no match for the signature '(api: MiddlewareAPI<Dispatch<AnyAction>, any>): (next: Dispatch<AnyAction>) => (action: any) => any'

constructor(private ngRedux: NgRedux<IAppState>, devTools: DevToolsExtension) { const enhancer = isDevMode() ? [devTools.enhancer()] : []; this.ngRedux.configureStore(reducers, initialState, enhancer); }

justintim-es avatar Dec 03 '19 19:12 justintim-es

I've got it working in angular8, typescript is happy with this:

  constructor(
    ngRedux: NgRedux<RctState>,
    devTools: DevToolsExtension,
    referenceApiEpics: ReferenceApiEpics,
    interchangeEpics: InterchangePropertyProfileEpics,
    valuationEpics: ValuationResultEpics,
    standardizedAddressEpics: StandardizedAddressEpics
  ) {
    const initialState: RctState = { };

    const epicMiddleware = createEpicMiddleware();

    ngRedux.configureStore(
      rootReducer,
      initialState,
      [
        epicMiddleware
      ],
      devTools.isEnabled() ? [devTools.enhancer()] : []
    );

    epicMiddleware.run(combineEpics<any>(
      ...referenceApiEpics.createEpics(),
    ));
  }

dkowis avatar Dec 04 '19 16:12 dkowis