@tamagui/use-event
Advanced tools
Comparing version 1.0.1-rc.5.1 to 1.0.1-rc.6
{ | ||
"name": "@tamagui/use-event", | ||
"version": "1.0.1-rc.5.1", | ||
"version": "1.0.1-rc.6", | ||
"types": "./types/index.d.ts", | ||
@@ -15,4 +15,4 @@ "main": "dist/cjs", | ||
"watch": "tamagui-build --watch", | ||
"lint": "eslint src", | ||
"lint:fix": "yarn lint --fix", | ||
"lint": "../../node_modules/.bin/rome check src", | ||
"lint:fix": "../../node_modules/.bin/rome check --apply-suggested src", | ||
"clean": "tamagui-build clean", | ||
@@ -22,3 +22,3 @@ "clean:build": "tamagui-build clean:build" | ||
"devDependencies": { | ||
"@tamagui/build": "^1.0.1-rc.5.1", | ||
"@tamagui/build": "^1.0.1-rc.6", | ||
"react": "^18.2.0" | ||
@@ -25,0 +25,0 @@ }, |
@@ -12,3 +12,3 @@ import { useCallback, useEffect, useLayoutEffect, useRef } from 'react' | ||
initialValue?: any, | ||
forwardToFunction?: boolean | ||
forwardToFunction?: boolean, | ||
): () => A { | ||
@@ -21,5 +21,7 @@ const curRef = useRef<any>(initialValue ?? currentValue) | ||
return useCallback( | ||
forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current, | ||
[] | ||
forwardToFunction | ||
? (...args) => curRef.current?.apply(null, args) | ||
: () => curRef.current, | ||
[], | ||
) | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
14609
205