Skip to content

Commit

Permalink
add useSharedHooksState typing
Browse files Browse the repository at this point in the history
  • Loading branch information
dimapaloskin committed Nov 26, 2018
1 parent a1a52e9 commit 7fb520f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "react-shared-hooks",
"version": "0.0.5",
"description": "React shared hooks",
"main": "dist/index.js",
"main": "src/index.js",
"repository": "https://github.com/dimapaloskin/react-shared-hooks",
"author": "Dima Paloskin",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const createSharedHook = (useHook: Function, ...args: any[]) => {
}
}

export const useSharedHooksState = (selector: Function) => {
export const useSharedHooksState = <R: *>(selector: (states: Object) => R): R => {
const globalContext = useContext(GlobalContext)
const sharedHook = selector(globalContext.hooks)
const result = useContext(sharedHook.Context)
Expand Down

0 comments on commit 7fb520f

Please sign in to comment.