@tamagui/use-callback-ref
Advanced tools
Comparing version
@@ -30,27 +30,2 @@ "use strict"; | ||
var React = __toESM(require("react")); | ||
function _array_like_to_array(arr, len) { | ||
(len == null || len > arr.length) && (len = arr.length); | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _array_without_holes(arr) { | ||
if (Array.isArray(arr)) return _array_like_to_array(arr); | ||
} | ||
function _iterable_to_array(iter) { | ||
if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _non_iterable_spread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _to_consumable_array(arr) { | ||
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread(); | ||
} | ||
function _unsupported_iterable_to_array(o, minLen) { | ||
if (o) { | ||
if (typeof o == "string") return _array_like_to_array(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); | ||
} | ||
} | ||
function useCallbackRef(callback) { | ||
@@ -64,6 +39,4 @@ var callbackRef = React.useRef(callback); | ||
args[_key] = arguments[_key]; | ||
var _callbackRef_current, _callbackRef_current1; | ||
return (_callbackRef_current1 = callbackRef.current) === null || _callbackRef_current1 === void 0 ? void 0 : (_callbackRef_current = _callbackRef_current1).call.apply(_callbackRef_current, [ | ||
callbackRef | ||
].concat(_to_consumable_array(args))); | ||
var _callbackRef_current; | ||
return (_callbackRef_current = callbackRef.current) === null || _callbackRef_current === void 0 ? void 0 : _callbackRef_current.call(callbackRef, ...args); | ||
}; | ||
@@ -70,0 +43,0 @@ }, []); |
import * as React from "react"; | ||
function _array_like_to_array(arr, len) { | ||
(len == null || len > arr.length) && (len = arr.length); | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _array_without_holes(arr) { | ||
if (Array.isArray(arr)) return _array_like_to_array(arr); | ||
} | ||
function _iterable_to_array(iter) { | ||
if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _non_iterable_spread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
function _to_consumable_array(arr) { | ||
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread(); | ||
} | ||
function _unsupported_iterable_to_array(o, minLen) { | ||
if (o) { | ||
if (typeof o == "string") return _array_like_to_array(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); | ||
} | ||
} | ||
function useCallbackRef(callback) { | ||
@@ -35,6 +10,4 @@ var callbackRef = React.useRef(callback); | ||
args[_key] = arguments[_key]; | ||
var _callbackRef_current, _callbackRef_current1; | ||
return (_callbackRef_current1 = callbackRef.current) === null || _callbackRef_current1 === void 0 ? void 0 : (_callbackRef_current = _callbackRef_current1).call.apply(_callbackRef_current, [ | ||
callbackRef | ||
].concat(_to_consumable_array(args))); | ||
var _callbackRef_current; | ||
return (_callbackRef_current = callbackRef.current) === null || _callbackRef_current === void 0 ? void 0 : _callbackRef_current.call(callbackRef, ...args); | ||
}; | ||
@@ -41,0 +14,0 @@ }, []); |
{ | ||
"name": "@tamagui/use-callback-ref", | ||
"version": "1.110.5", | ||
"version": "1.111.0", | ||
"types": "./types/index.d.ts", | ||
@@ -21,3 +21,3 @@ "main": "dist/cjs", | ||
"devDependencies": { | ||
"@tamagui/build": "1.110.5" | ||
"@tamagui/build": "1.111.0" | ||
}, | ||
@@ -24,0 +24,0 @@ "exports": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
17
13.33%11815
-13.34%156
-20%