@tamagui/use-event 1.88.21 → 1.88.23
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/esm/index.native.js
CHANGED
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
return to;
|
|
11
|
-
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
12
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
13
|
-
var src_exports = {};
|
|
14
|
-
module.exports = __toCommonJS(src_exports);
|
|
15
|
-
__reExport(src_exports, require("./useEvent"), module.exports);
|
|
16
|
-
__reExport(src_exports, require("./useGet"), module.exports);
|
|
17
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
18
|
-
0 && (module.exports = {
|
|
19
|
-
...require("./useEvent"),
|
|
20
|
-
...require("./useGet")
|
|
21
|
-
});
|
|
1
|
+
export * from "./useEvent";
|
|
2
|
+
export * from "./useGet";
|
|
22
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var useEvent_exports = {};
|
|
17
|
-
__export(useEvent_exports, {
|
|
18
|
-
useEvent: () => useEvent
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(useEvent_exports);
|
|
21
|
-
var import_useGet = require("./useGet");
|
|
1
|
+
import { useGet } from "./useGet";
|
|
22
2
|
function useEvent(callback) {
|
|
23
|
-
return
|
|
3
|
+
return useGet(callback, defaultValue, !0);
|
|
24
4
|
}
|
|
25
5
|
const defaultValue = () => {
|
|
26
6
|
throw new Error("Cannot call an event handler while rendering.");
|
|
27
7
|
};
|
|
28
|
-
|
|
29
|
-
0 && (module.exports = {
|
|
8
|
+
export {
|
|
30
9
|
useEvent
|
|
31
|
-
}
|
|
10
|
+
};
|
|
32
11
|
//# sourceMappingURL=useEvent.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useEvent.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,cAAc;AAIhB,SAAS,SAAgC,UAAiB;AAC/D,SAAO,OAAO,UAAU,cAAc,EAAI;AAC5C;AAEA,MAAM,eAAe,MAAM;AACzB,QAAM,IAAI,MAAM,+CAA+C;AACjE;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,29 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var useGet_exports = {};
|
|
17
|
-
__export(useGet_exports, {
|
|
18
|
-
useGet: () => useGet
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(useGet_exports);
|
|
21
|
-
var import_constants = require("@tamagui/constants"), import_react = require("react");
|
|
1
|
+
import { useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
2
|
+
import { useCallback, useRef } from "react";
|
|
22
3
|
function useGet(currentValue, initialValue, forwardToFunction) {
|
|
23
|
-
const curRef =
|
|
24
|
-
return
|
|
4
|
+
const curRef = useRef(initialValue ?? currentValue);
|
|
5
|
+
return useIsomorphicLayoutEffect(() => {
|
|
25
6
|
curRef.current = currentValue;
|
|
26
|
-
}),
|
|
7
|
+
}), useCallback(
|
|
27
8
|
forwardToFunction ? (...args) => {
|
|
28
9
|
var _a;
|
|
29
10
|
return (_a = curRef.current) == null ? void 0 : _a.apply(null, args);
|
|
@@ -31,8 +12,7 @@ function useGet(currentValue, initialValue, forwardToFunction) {
|
|
|
31
12
|
[]
|
|
32
13
|
);
|
|
33
14
|
}
|
|
34
|
-
|
|
35
|
-
0 && (module.exports = {
|
|
15
|
+
export {
|
|
36
16
|
useGet
|
|
37
|
-
}
|
|
17
|
+
};
|
|
38
18
|
//# sourceMappingURL=useGet.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useGet.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,iCAAiC;AAC1C,SAAS,aAAa,cAAc;AAI7B,SAAS,OACd,cACA,cACA,mBACS;AACT,QAAM,SAAS,OAAY,gBAAgB,YAAY;AACvD,mCAA0B,MAAM;AAC9B,WAAO,UAAU;AAAA,EACnB,CAAC,GAEM;AAAA,IACL,oBACI,IAAI,SAAM;AAjBlB;AAiBqB,0BAAO,YAAP,mBAAgB,MAAM,MAAM;AAAA,QACzC,MAAM,OAAO;AAAA,IACjB,CAAC;AAAA,EACH;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-event",
|
|
3
|
-
"version": "1.88.
|
|
3
|
+
"version": "1.88.23",
|
|
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.88.
|
|
21
|
+
"@tamagui/build": "1.88.23",
|
|
22
22
|
"react": "^18.2.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@tamagui/constants": "1.88.
|
|
25
|
+
"@tamagui/constants": "1.88.23"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "*"
|