platform
platform copied to clipboard
Redux Devtools angular 8
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); }
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(),
));
}