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:
Brian Buchalter
2017-12-21 11:48:22 -07:00
parent 11b5878146
commit fa1324e2e5
+3 -2
View File
@@ -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>;