diff --git a/package.json b/package.json index d1140c2..1c60ae3 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/index.js b/src/index.js index c1ac86b..1a23eed 100644 --- a/src/index.js +++ b/src/index.js @@ -26,7 +26,7 @@ export const createSharedHook = (useHook: Function, ...args: any[]) => { } } -export const useSharedHooksState = (selector: Function) => { +export const useSharedHooksState = (selector: (states: Object) => R): R => { const globalContext = useContext(GlobalContext) const sharedHook = selector(globalContext.hooks) const result = useContext(sharedHook.Context)