mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[TS 2] redux-mock-store tweaks (#11614)
This commit is contained in:
parent
82ed03dce3
commit
282de8d987
@ -41,3 +41,7 @@ store.dispatch({ type: 'INCREMENT' });
|
||||
var actions: Array<any> = store.getActions();
|
||||
|
||||
store.clearActions();
|
||||
|
||||
// actions access without the need to cast
|
||||
var actions2 = store.getActions();
|
||||
actions2[10].payload.id;
|
||||
16
redux-mock-store/redux-mock-store.d.ts
vendored
16
redux-mock-store/redux-mock-store.d.ts
vendored
@ -8,16 +8,16 @@
|
||||
declare module 'redux-mock-store' {
|
||||
import * as Redux from 'redux'
|
||||
|
||||
function createMockStore<T>(middlewares?:Redux.Middleware[]):mockStore<T>
|
||||
function createMockStore<T>(middlewares?: Redux.Middleware[]): mockStore<T>;
|
||||
|
||||
export type mockStore<T> = (state?:T) => IStore<T>;
|
||||
export type mockStore<T> = (state?: T) => IStore<T>;
|
||||
|
||||
export type IStore<T> = {
|
||||
dispatch(action: any):any
|
||||
getState():T
|
||||
getActions():Object[]
|
||||
clearActions():void
|
||||
subscribe(listener: Function):Function
|
||||
export interface IStore<T> {
|
||||
dispatch(action: any): any;
|
||||
getState(): T;
|
||||
getActions(): any[];
|
||||
clearActions(): void;
|
||||
subscribe(listener: Function): Function;
|
||||
}
|
||||
|
||||
export default createMockStore
|
||||
|
||||
Loading…
Reference in New Issue
Block a user