mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Generic param default for MockStoreCreator
As of TypeScript 2.3, there is now [support for Generic parameter defaults](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-3.html). By setting a reasonable default type on `MockStoreCreator`, we can eliminate unneeded verbosity.
This commit is contained in:
Vendored
+3
-2
@@ -1,7 +1,8 @@
|
||||
// Type definitions for Redux Mock Store 0.0
|
||||
// Type definitions for Redux Mock Store 0.0.1
|
||||
// Project: https://github.com/arnaudbenard/redux-mock-store
|
||||
// Definitions by: Marian Palkus <https://github.com/MarianPalkus>, Cap3 <http://www.cap3.de>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as Redux from 'redux';
|
||||
|
||||
@@ -10,7 +11,7 @@ export interface MockStore<T> extends Redux.Store<T> {
|
||||
clearActions(): void;
|
||||
}
|
||||
|
||||
export type MockStoreCreator<T> = (state?: T) => MockStore<T>;
|
||||
export type MockStoreCreator<T = {}> = (state?: T) => MockStore<T>;
|
||||
|
||||
declare function createMockStore<T>(middlewares?: Redux.Middleware[]): MockStoreCreator<T>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user