@tamagui/use-event 1.89.26 → 1.89.27-1708113113238
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.native.js.map +2 -2
- package/dist/cjs/useEvent.native.js +1 -1
- package/dist/cjs/useEvent.native.js.map +3 -3
- package/dist/cjs/useGet.native.js +10 -9
- package/dist/cjs/useGet.native.js.map +3 -3
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/useEvent.native.js +1 -1
- package/dist/esm/useEvent.native.js.map +3 -3
- package/dist/esm/useGet.native.js +10 -9
- package/dist/esm/useGet.native.js.map +3 -3
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;AAAA
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/use-event/src/index.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;AAAA;;wBAAc,uBAAd;AACA,wBAAc,qBADd;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -22,7 +22,7 @@ var import_useGet = require("./useGet");
|
|
|
22
22
|
function useEvent(callback) {
|
|
23
23
|
return (0, import_useGet.useGet)(callback, defaultValue, !0);
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
var defaultValue = function() {
|
|
26
26
|
throw new Error("Cannot call an event handler while rendering.");
|
|
27
27
|
};
|
|
28
28
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/useEvent.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA
|
|
5
|
-
"names": []
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/use-event/src/useEvent.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;;;;;oBAAuB;AAIhB,SAASA,SAAgCC,UAAY;AAC1D,aAAOC,sBAAOD,UAAUE,cAAc,EAAA;AACxC;AAEA,IAAMA,eAAe,WAAA;AACnB,QAAM,IAAIC,MAAM,+CAAA;AAClB;",
|
|
5
|
+
"names": ["useEvent", "callback", "useGet", "defaultValue", "Error"]
|
|
6
6
|
}
|
|
@@ -20,16 +20,17 @@ __export(useGet_exports, {
|
|
|
20
20
|
module.exports = __toCommonJS(useGet_exports);
|
|
21
21
|
var import_constants = require("@tamagui/constants"), import_react = require("react");
|
|
22
22
|
function useGet(currentValue, initialValue, forwardToFunction) {
|
|
23
|
-
|
|
24
|
-
return (0, import_constants.useIsomorphicLayoutEffect)(()
|
|
23
|
+
var curRef = (0, import_react.useRef)(initialValue ?? currentValue);
|
|
24
|
+
return (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
25
25
|
curRef.current = currentValue;
|
|
26
|
-
}), (0, import_react.useCallback)(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
}), (0, import_react.useCallback)(forwardToFunction ? function() {
|
|
27
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)
|
|
28
|
+
args[_key] = arguments[_key];
|
|
29
|
+
var _curRef_current;
|
|
30
|
+
return (_curRef_current = curRef.current) === null || _curRef_current === void 0 ? void 0 : _curRef_current.apply(null, args);
|
|
31
|
+
} : function() {
|
|
32
|
+
return curRef.current;
|
|
33
|
+
}, []);
|
|
33
34
|
}
|
|
34
35
|
// Annotate the CommonJS export names for ESM import in node:
|
|
35
36
|
0 && (module.exports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/useGet.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA
|
|
5
|
-
"names": []
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/use-event/src/useGet.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;;;;;uBAA0C,+BAC1C,eAAoC;AAI7B,SAASA,OACdC,cACAC,cACAC,mBAA2B;AAE3B,MAAMC,aAASC,qBAAYH,gBAAgBD,YAAAA;AAC3CK,yDAA0B,WAAA;AACxBF,WAAOG,UAAUN;EACnB,CAAA,OAEOO,0BACLL,oBACI,WAAA;sCAAIM,OAAAA,IAAAA,MAAAA,IAAAA,GAAAA,OAAAA,GAAAA,OAAAA,MAAAA;AAAAA,WAAAA,IAAAA,IAAAA,UAAAA,IAAAA;QAASL;YAAAA,kBAAAA,OAAOG,aAAO,QAAdH,oBAAAA,SAAAA,SAAAA,gBAAgBM,MAAM,MAAMD,IAAAA;MACzC,WAAA;WAAML,OAAOG;KACjB,CAAA,CAAE;AAEN;",
|
|
5
|
+
"names": ["useGet", "currentValue", "initialValue", "forwardToFunction", "curRef", "useRef", "useIsomorphicLayoutEffect", "current", "useCallback", "args", "apply"]
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/useEvent.ts"],
|
|
4
|
-
"mappings": "AAAA,
|
|
5
|
-
"names": []
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/use-event/src/useEvent.ts"],
|
|
4
|
+
"mappings": "AAAA,SAASA,cAAc;AAIhB,SAASC,SAAgCC,UAAY;AAC1D,SAAOF,OAAOE,UAAUC,cAAc,EAAA;AACxC;AAEA,IAAMA,eAAe,WAAA;AACnB,QAAM,IAAIC,MAAM,+CAAA;AAClB;",
|
|
5
|
+
"names": ["useGet", "useEvent", "callback", "defaultValue", "Error"]
|
|
6
6
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
2
2
|
import { useCallback, useRef } from "react";
|
|
3
3
|
function useGet(currentValue, initialValue, forwardToFunction) {
|
|
4
|
-
|
|
5
|
-
return useIsomorphicLayoutEffect(()
|
|
4
|
+
var curRef = useRef(initialValue ?? currentValue);
|
|
5
|
+
return useIsomorphicLayoutEffect(function() {
|
|
6
6
|
curRef.current = currentValue;
|
|
7
|
-
}), useCallback(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
}), useCallback(forwardToFunction ? function() {
|
|
8
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)
|
|
9
|
+
args[_key] = arguments[_key];
|
|
10
|
+
var _curRef_current;
|
|
11
|
+
return (_curRef_current = curRef.current) === null || _curRef_current === void 0 ? void 0 : _curRef_current.apply(null, args);
|
|
12
|
+
} : function() {
|
|
13
|
+
return curRef.current;
|
|
14
|
+
}, []);
|
|
14
15
|
}
|
|
15
16
|
export {
|
|
16
17
|
useGet
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/useGet.ts"],
|
|
4
|
-
"mappings": "AAAA,
|
|
5
|
-
"names": []
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/use-event/src/useGet.ts"],
|
|
4
|
+
"mappings": "AAAA,SAASA,iCAAiC;AAC1C,SAASC,aAAaC,cAAc;AAI7B,SAASC,OACdC,cACAC,cACAC,mBAA2B;AAE3B,MAAMC,SAASL,OAAYG,gBAAgBD,YAAAA;AAC3CJ,mCAA0B,WAAA;AACxBO,WAAOC,UAAUJ;EACnB,CAAA,GAEOH,YACLK,oBACI,WAAA;sCAAIG,OAAAA,IAAAA,MAAAA,IAAAA,GAAAA,OAAAA,GAAAA,OAAAA,MAAAA;AAAAA,WAAAA,IAAAA,IAAAA,UAAAA,IAAAA;QAASF;YAAAA,kBAAAA,OAAOC,aAAO,QAAdD,oBAAAA,SAAAA,SAAAA,gBAAgBG,MAAM,MAAMD,IAAAA;MACzC,WAAA;WAAMF,OAAOC;KACjB,CAAA,CAAE;AAEN;",
|
|
5
|
+
"names": ["useIsomorphicLayoutEffect", "useCallback", "useRef", "useGet", "currentValue", "initialValue", "forwardToFunction", "curRef", "current", "args", "apply"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-event",
|
|
3
|
-
"version": "1.89.
|
|
3
|
+
"version": "1.89.27-1708113113238",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"clean:build": "tamagui-build clean:build"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@tamagui/build": "1.89.
|
|
21
|
+
"@tamagui/build": "1.89.27-1708113113238",
|
|
22
22
|
"react": "^18.2.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@tamagui/constants": "1.89.
|
|
25
|
+
"@tamagui/constants": "1.89.27-1708113113238"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "*"
|