forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added definitions for redux-subscriber (DefinitelyTyped#44534)
* added definitions for redux-subscriber * added one set of functions to the tests * Update types/redux-subscriber/index.d.ts Co-authored-by: Piotr Błażejewicz (Peter Blazejewicz) <[email protected]> Co-authored-by: Nathan Shively-Sanders <[email protected]> Co-authored-by: Piotr Błażejewicz (Peter Blazejewicz) <[email protected]>
- Loading branch information
1 parent
11cd024
commit 6684c8c
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Type definitions for redux-subscriber 1.1 | ||
// Project: https://github.com/ivantsov/redux-subscriber#readme | ||
// Definitions by: thisissami <https://github.com/thisissami> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
|
||
export type Unsubscribe = () => void; | ||
export type Subscribe = (key: string, cb: (state: any) => void) => Unsubscribe; | ||
|
||
export default function(store: any): Subscribe; | ||
|
||
export const subscribe: Subscribe; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import initSubscriber, { subscribe, Subscribe, Unsubscribe } from 'redux-subscriber'; | ||
|
||
const subscribe2: Subscribe = initSubscriber({}); | ||
const unsubscribe: Unsubscribe = subscribe('', state => {}); | ||
const unsubscribe2: Unsubscribe = subscribe2('', state => {}); | ||
|
||
unsubscribe(); | ||
unsubscribe2(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"lib": [ | ||
"es6" | ||
], | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"strictFunctionTypes": true, | ||
"strictNullChecks": true, | ||
"baseUrl": "../", | ||
"typeRoots": [ | ||
"../" | ||
], | ||
"types": [], | ||
"noEmit": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"files": [ | ||
"index.d.ts", | ||
"redux-subscriber-tests.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "extends": "dtslint/dt.json" } |