diff --git a/redux-recycle/index.d.ts b/redux-recycle/index.d.ts new file mode 100644 index 0000000000..4405e53e48 --- /dev/null +++ b/redux-recycle/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for redux-recycle 1.2 +// Project: https://github.com/omnidan/redux-recycle +// Definitions by: Karol Janyst +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Reducer } from "redux"; + +export default function recycleState (reducer: Reducer, actions: string[], initialState?: A | Reducer): Reducer; + diff --git a/redux-recycle/package.json b/redux-recycle/package.json new file mode 100644 index 0000000000..e52256ea90 --- /dev/null +++ b/redux-recycle/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} \ No newline at end of file diff --git a/redux-recycle/redux-recycle-tests.ts b/redux-recycle/redux-recycle-tests.ts new file mode 100644 index 0000000000..c831102d5a --- /dev/null +++ b/redux-recycle/redux-recycle-tests.ts @@ -0,0 +1,8 @@ +import { Reducer } from "redux"; +import recycleState from "redux-recycle"; + +const reducer: Reducer = (state: any, action: any) => ({}); +const otherReducer: Reducer = (state: any, action: any) => ({}); + +const resetReducer: Reducer = recycleState(reducer, ["reset"], {}); +const resetToOtherReducer: Reducer = recycleState(reducer, ["reset"], otherReducer); diff --git a/redux-recycle/tsconfig.json b/redux-recycle/tsconfig.json new file mode 100644 index 0000000000..e5bf4e4310 --- /dev/null +++ b/redux-recycle/tsconfig.json @@ -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" + ] +}