Skip to content

Commit

Permalink
Fix unkownaction typing
Browse files Browse the repository at this point in the history
  • Loading branch information
simensma-fresh committed Dec 19, 2024
1 parent 0cdf85e commit 9676ebb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions services/common/src/redux/rootState.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sharedReducer } from "@mds/common/redux/reducers/rootReducerShared";
import { configureStore, Dispatch } from "@reduxjs/toolkit";
import { configureStore, Dispatch, UnknownAction } from "@reduxjs/toolkit";
import { loadingBarReducer } from "react-redux-loading-bar";

import type { TypedUseSelectorHook } from 'react-redux'
Expand All @@ -24,8 +24,10 @@ export const store = getStore();

type RootState = ReturnType<typeof store.getState>;

// Infer the `RootState` and `AppDispatch` types from the store itself + make sure redux-form actions are captured as well.
export type AppDispatch = typeof store.dispatch & Dispatch<FormAction>;
type AppAction = UnknownAction | FormAction;

// Infer the `RootState` and `AppDispatch` types from the store itself + make sure redux-form acti are captured as well.
export type AppDispatch = typeof store.dispatch & Dispatch<AppAction>;
export type AppStore = typeof store;

// Use throughout your app instead of plain `useDispatch` and `useSelector`
Expand Down

0 comments on commit 9676ebb

Please sign in to comment.