mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-04 17:20:09 +00:00
Add method option for mocking getState method (#34988)
As in the docs to the main JS library you can either supply state to the MockStoreCreator or you can pass a method in which is given the list of currently dispatched actions
This commit is contained in:
committed by
Wesley Wigham
parent
db485fd27b
commit
af02c4bcb1
4
types/redux-mock-store/index.d.ts
vendored
4
types/redux-mock-store/index.d.ts
vendored
@@ -13,7 +13,9 @@ export interface MockStore<S = any, A extends Redux.Action = Redux.AnyAction> ex
|
||||
|
||||
export type MockStoreEnhanced<S = {}, DispatchExts = {}> = MockStore<S> & {dispatch: DispatchExts};
|
||||
|
||||
export type MockStoreCreator<S = {}, DispatchExts = {}> = (state?: S) => MockStoreEnhanced<S, DispatchExts>;
|
||||
export type MockStoreCreator<S = {}, DispatchExts = {}> = (state?: S | MockGetState<S>) => MockStoreEnhanced<S, DispatchExts>;
|
||||
|
||||
export type MockGetState<S = {}> = (actions: Redux.AnyAction[]) => S;
|
||||
|
||||
/**
|
||||
* Create Mock Store returns a function that will create a mock store from a state
|
||||
|
||||
Reference in New Issue
Block a user