-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Milestone
Description
The documentation is missing typing on action. https://redux.js.org/usage/usage-with-typescript#type-checking-middleware
export type AppStore = typeof store;
export type AppState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;
export type AppMiddleware = Middleware<void, AppState, AppDispatch>;
export const loggerMiddleware: AppMiddleware =
(storeApi) => (next) => (action) => {
const state = storeApi.getState();
console.log(action.type, state); // Unsafe member access .type on an `any` value.
return next(action); // Unsafe return of an `any` typed value.
};Metadata
Metadata
Assignees
Labels
No labels