@tamagui/use-event
Advanced tools
Comparing version 1.125.6 to 1.125.7
@@ -1,3 +0,3 @@ | ||
export * from "./useEvent"; | ||
export * from "./useGet"; | ||
//# sourceMappingURL=index.js.map | ||
export * from "./useEvent.native.js"; | ||
export * from "./useGet.native.js"; | ||
//# sourceMappingURL=index.native.js.map |
@@ -1,11 +0,9 @@ | ||
import { useGet } from "./useGet"; | ||
import { useGet } from "./useGet.native.js"; | ||
function useEvent(callback) { | ||
return useGet(callback, defaultValue, !0); | ||
} | ||
var defaultValue = function() { | ||
var defaultValue = function () { | ||
throw new Error("Cannot call an event handler while rendering."); | ||
}; | ||
export { | ||
useEvent | ||
}; | ||
//# sourceMappingURL=useEvent.js.map | ||
export { useEvent }; | ||
//# sourceMappingURL=useEvent.native.js.map |
@@ -5,16 +5,13 @@ import { useIsomorphicLayoutEffect } from "@tamagui/constants"; | ||
var curRef = React.useRef(initialValue ?? currentValue); | ||
return useIsomorphicLayoutEffect(function() { | ||
return useIsomorphicLayoutEffect(function () { | ||
curRef.current = currentValue; | ||
}), React.useCallback(forwardToFunction ? function() { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) | ||
args[_key] = arguments[_key]; | ||
}), React.useCallback(forwardToFunction ? function () { | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; | ||
var _curRef_current; | ||
return (_curRef_current = curRef.current) === null || _curRef_current === void 0 ? void 0 : _curRef_current.apply(null, args); | ||
} : function() { | ||
} : function () { | ||
return curRef.current; | ||
}, []); | ||
} | ||
export { | ||
useGet | ||
}; | ||
//# sourceMappingURL=useGet.js.map | ||
export { useGet }; | ||
//# sourceMappingURL=useGet.native.js.map |
{ | ||
"name": "@tamagui/use-event", | ||
"version": "1.125.6", | ||
"version": "1.125.7", | ||
"types": "./types/index.d.ts", | ||
@@ -21,7 +21,7 @@ "main": "dist/cjs", | ||
"devDependencies": { | ||
"@tamagui/build": "1.125.6", | ||
"@tamagui/build": "1.125.7", | ||
"react": "*" | ||
}, | ||
"dependencies": { | ||
"@tamagui/constants": "1.125.6" | ||
"@tamagui/constants": "1.125.7" | ||
}, | ||
@@ -28,0 +28,0 @@ "exports": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
26066
388
+ Added@tamagui/constants@1.125.7(transitive)
- Removed@tamagui/constants@1.125.6(transitive)
Updated@tamagui/constants@1.125.7