Add definitions for redux-recycle (#13424)

* Add definitions for redux-recycle

* Fix linter errors
This commit is contained in:
Karol Janyst
2016-12-19 14:41:47 -08:00
committed by Andy
parent 1f60ecb795
commit fb1cf61bca
4 changed files with 41 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for redux-recycle 1.2
// Project: https://github.com/omnidan/redux-recycle
// Definitions by: Karol Janyst <https://github.com/LKay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { Reducer } from "redux";
export default function recycleState<A> (reducer: Reducer<A>, actions: string[], initialState?: A | Reducer<A>): Reducer<A>;
+5
View File
@@ -0,0 +1,5 @@
{
"dependencies": {
"redux": "^3.6.0"
}
}
+8
View File
@@ -0,0 +1,8 @@
import { Reducer } from "redux";
import recycleState from "redux-recycle";
const reducer: Reducer<any> = (state: any, action: any) => ({});
const otherReducer: Reducer<any> = (state: any, action: any) => ({});
const resetReducer: Reducer<any> = recycleState(reducer, ["reset"], {});
const resetToOtherReducer: Reducer<any> = recycleState(reducer, ["reset"], otherReducer);
+19
View File
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"redux-recycle-tests.ts"
]
}