From 4cb3465a9428df69947766b5013398d4d3d541f3 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Mon, 5 Aug 2024 22:05:57 -0400 Subject: [PATCH] test-tab-demo --- .../demo/src/index.tsx | 8 ++--- .../demo/src/reducers.ts | 30 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/redux-devtools-inspector-monitor-test-tab/demo/src/index.tsx b/packages/redux-devtools-inspector-monitor-test-tab/demo/src/index.tsx index b05d6233..b1a63ee0 100644 --- a/packages/redux-devtools-inspector-monitor-test-tab/demo/src/index.tsx +++ b/packages/redux-devtools-inspector-monitor-test-tab/demo/src/index.tsx @@ -33,9 +33,9 @@ const useDevtoolsExtension = !!(window as unknown as { __REDUX_DEVTOOLS_EXTENSION__: unknown }) && getOptions(window.location).useExtension; -const enhancer = compose( +const enhancer: StoreEnhancer = compose( applyMiddleware(logger), - (next: StoreEnhancerStoreCreator) => { + ((next) => { const instrument = useDevtoolsExtension ? ( window as unknown as { @@ -44,9 +44,9 @@ const enhancer = compose( ).__REDUX_DEVTOOLS_EXTENSION__() : DevTools.instrument(); return instrument(next); - }, + }) as StoreEnhancer, persistState(getDebugSessionKey()), -); +) as any; const store = createStore(rootReducer, enhancer); diff --git a/packages/redux-devtools-inspector-monitor-test-tab/demo/src/reducers.ts b/packages/redux-devtools-inspector-monitor-test-tab/demo/src/reducers.ts index 5e193ea0..6c6a4dfe 100644 --- a/packages/redux-devtools-inspector-monitor-test-tab/demo/src/reducers.ts +++ b/packages/redux-devtools-inspector-monitor-test-tab/demo/src/reducers.ts @@ -155,12 +155,12 @@ export interface DemoAppState { } export const rootReducer: Reducer = - combineReducers({ - timeoutUpdateEnabled: (state = false, action) => + combineReducers({ + timeoutUpdateEnabled: (state = false, action: DemoAppAction) => action.type === 'TOGGLE_TIMEOUT_UPDATE' ? action.timeoutUpdateEnabled : state, - store: (state = 0, action) => + store: (state = 0, action: DemoAppAction) => action.type === 'INCREMENT' ? state + 1 : state, undefined: (state = { val: undefined }) => state, null: (state = null) => state, @@ -169,7 +169,7 @@ export const rootReducer: Reducer = // noop }, ) => state, - array: (state = [], action) => + array: (state = [], action: DemoAppAction) => action.type === 'PUSH' ? [...state, Math.random()] : action.type === 'POP' @@ -177,13 +177,13 @@ export const rootReducer: Reducer = : action.type === 'REPLACE' ? [Math.random(), ...state.slice(1)] : state, - hugeArrays: (state = [], action) => + hugeArrays: (state = [], action: DemoAppAction) => action.type === 'PUSH_HUGE_ARRAY' ? [...state, ...HUGE_ARRAY] : state, - hugeObjects: (state = [], action) => + hugeObjects: (state = [], action: DemoAppAction) => action.type === 'ADD_HUGE_OBJECT' ? [...state, HUGE_OBJECT] : state, - iterators: (state = [], action) => + iterators: (state = [], action: DemoAppAction) => action.type === 'ADD_ITERATOR' ? [...state, createIterator()] : state, - nested: (state = NESTED, action) => + nested: (state = NESTED, action: DemoAppAction) => action.type === 'CHANGE_NESTED' ? { ...state, @@ -200,23 +200,23 @@ export const rootReducer: Reducer = }, } : state, - recursive: (state = [], action) => + recursive: (state = [], action: DemoAppAction) => action.type === 'ADD_RECURSIVE' ? [...state, { ...RECURSIVE }] : state, - immutables: (state = [], action) => + immutables: (state = [], action: DemoAppAction) => action.type === 'ADD_IMMUTABLE_MAP' ? [...state, IMMUTABLE_MAP] : state, - immutableNested: (state = IMMUTABLE_NESTED, action) => + immutableNested: (state = IMMUTABLE_NESTED, action: DemoAppAction) => action.type === 'CHANGE_IMMUTABLE_NESTED' ? state.updateIn( ['long', 'nested', 0, 'path', 'to', 'a'], (str: unknown) => (str as string) + '!', ) : state, - addFunction: (state = null, action) => + addFunction: (state = null, action: DemoAppAction) => action.type === 'ADD_FUNCTION' ? { f: FUNC } : state, - addSymbol: (state = null, action) => + addSymbol: (state = null, action: DemoAppAction) => action.type === 'ADD_SYMBOL' ? { s: window.Symbol('symbol'), error: new Error('TEST') } : state, - shuffleArray: (state = DEFAULT_SHUFFLE_ARRAY, action) => + shuffleArray: (state = DEFAULT_SHUFFLE_ARRAY, action: DemoAppAction) => action.type === 'SHUFFLE_ARRAY' ? shuffle(state) : state, - }); + }) as any;