@tamagui/use-event 2.7.7 → 3.0.0-beta.643.1

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.
@@ -1,21 +1,20 @@
1
+
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
6
  var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
- get: () => from[key],
9
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
- });
11
- }
12
- return to;
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
9
+ get: () => from[key],
10
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
+ });
12
+ }
13
+ return to;
13
14
  };
14
15
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
16
- value: true
17
- }), mod);
16
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
17
  var index_exports = {};
19
18
  module.exports = __toCommonJS(index_exports);
20
19
  __reExport(index_exports, require("./useEvent.cjs"), module.exports);
21
- __reExport(index_exports, require("./useGet.cjs"), module.exports);
20
+ __reExport(index_exports, require("./useGet.cjs"), module.exports);
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13
+ });
14
+ }
15
+ return to;
16
+ };
17
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var index_exports = {};
20
+ module.exports = __toCommonJS(index_exports);
21
+ __reExport(index_exports, require("./useEvent.native.js"), module.exports);
22
+ __reExport(index_exports, require("./useGet.native.js"), module.exports);
@@ -1,24 +1,24 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from === "object" || typeof from === "function") {
9
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
- get: () => from[key],
11
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
- });
13
- }
14
- return to;
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13
+ });
14
+ }
15
+ return to;
15
16
  };
16
17
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
18
- value: true
19
- }), mod);
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
19
  var index_exports = {};
21
20
  module.exports = __toCommonJS(index_exports);
22
21
  __reExport(index_exports, require("./useEvent.native.js"), module.exports);
23
22
  __reExport(index_exports, require("./useGet.native.js"), module.exports);
23
+
24
24
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports","__reExport","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA;AACdG,UAAA,CAAAH,aAAA,EAAcI,OAAA,wBADd,EAAAH,MAAA,CAAAC,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./useEvent\"), module.exports);\n__reExport(index_exports, require(\"./useGet\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,sBAAY,GAAG,OAAO,OAAO;AAC/D,WAAW,eAAe,QAAQ,oBAAU,GAAG,OAAO,OAAO"}
@@ -1,34 +1,31 @@
1
+
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
6
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
7
+ for (var name in all) __defProp(target, name, {
8
+ get: all[name],
9
+ enumerable: true
10
+ });
10
11
  };
11
12
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ return to;
19
20
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
22
  var useEvent_exports = {};
24
- __export(useEvent_exports, {
25
- useEvent: () => useEvent
26
- });
23
+ __export(useEvent_exports, { useEvent: () => useEvent });
27
24
  module.exports = __toCommonJS(useEvent_exports);
28
25
  var import_useGet = require("./useGet.cjs");
29
26
  function useEvent(callback) {
30
- return (0, import_useGet.useGet)(callback, defaultValue, true);
27
+ return (0, import_useGet.useGet)(callback, defaultValue, true);
31
28
  }
32
29
  const defaultValue = () => {
33
- throw new Error("Cannot call an event handler while rendering.");
34
- };
30
+ throw new Error("Cannot call an event handler while rendering.");
31
+ };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
22
+ };
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
+ var useEvent_exports = {};
25
+ __export(useEvent_exports, { useEvent: () => useEvent });
26
+ module.exports = __toCommonJS(useEvent_exports);
27
+ var import_useGet = require("./useGet.native.js");
28
+ function useEvent(callback) {
29
+ return (0, import_useGet.useGet)(callback, defaultValue, true);
30
+ }
31
+ var defaultValue = function() {
32
+ throw new Error("Cannot call an event handler while rendering.");
33
+ };
@@ -1,37 +1,35 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
12
13
  };
13
14
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
21
22
  };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
24
  var useEvent_exports = {};
26
- __export(useEvent_exports, {
27
- useEvent: () => useEvent
28
- });
25
+ __export(useEvent_exports, { useEvent: () => useEvent });
29
26
  module.exports = __toCommonJS(useEvent_exports);
30
27
  var import_useGet = require("./useGet.native.js");
31
28
  function useEvent(callback) {
32
- return (0, import_useGet.useGet)(callback, defaultValue, true);
29
+ return (0, import_useGet.useGet)(callback, defaultValue, true);
33
30
  }
34
- var defaultValue = function () {
35
- throw new Error("Cannot call an event handler while rendering.");
31
+ var defaultValue = function() {
32
+ throw new Error("Cannot call an event handler while rendering.");
36
33
  };
34
+
37
35
  //# sourceMappingURL=useEvent.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useEvent_exports","__export","useEvent","module","exports","import_useGet","require","callback","useGet","defaultValue","Error"],"sources":["../../src/useEvent.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,gBAAA;AAAAC,QAAA,CAAAD,gBAAA;EAAAE,QAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAuB,CAAAK,gBAAA;AAIhB,IAAAK,aAAS,GAAgCC,OAAA,CAAiB;AAC/D,SAAAJ,QAAOA,CAAAK,QAAA;EACT,WAAAF,aAAA,CAAAG,MAAA,EAAAD,QAAA,EAAAE,YAAA;AAEA;AACE,IAAAA,YAAU,GAAM,SAAAA,CAAA;EAClB,UAAAC,KAAA","ignoreList":[]}
1
+ {"version":3,"file":"useEvent.native.js","names":[],"sources":["cjs/useEvent.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useEvent_exports = {};\n__export(useEvent_exports, {\n useEvent: () => useEvent\n});\nmodule.exports = __toCommonJS(useEvent_exports);\nvar import_useGet = require(\"./useGet\");\nfunction useEvent(callback) {\n return (0, import_useGet.useGet)(callback, defaultValue, true);\n}\nvar defaultValue = function() {\n throw new Error(\"Cannot call an event handler while rendering.\");\n};\n//# sourceMappingURL=useEvent.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,mBAAmB,CAAC;AACxB,SAAS,kBAAkB,EACzB,gBAAgB,SAClB,CAAC;AACD,OAAO,UAAU,aAAa,gBAAgB;AAC9C,IAAI,gBAAgB,QAAQ,oBAAU;AACtC,SAAS,SAAS,UAAU;CAC1B,QAAQ,GAAG,cAAc,QAAQ,UAAU,cAAc,IAAI;AAC/D;AACA,IAAI,eAAe,WAAW;CAC5B,MAAM,IAAI,MAAM,+CAA+C;AACjE"}
@@ -1,3 +1,4 @@
1
+
1
2
  var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -5,43 +6,34 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
6
  var __getProtoOf = Object.getPrototypeOf;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
12
13
  };
13
14
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
21
22
  };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: true
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
30
26
  }) : target, mod));
31
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: true
33
- }), mod);
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
28
  var useGet_exports = {};
35
- __export(useGet_exports, {
36
- useGet: () => useGet
37
- });
29
+ __export(useGet_exports, { useGet: () => useGet });
38
30
  module.exports = __toCommonJS(useGet_exports);
39
31
  var React = __toESM(require("react"), 1);
40
32
  const useIsomorphicInsertionEffect = React.useInsertionEffect || React.useLayoutEffect;
41
33
  function useGet(currentValue, initialValue, forwardToFunction) {
42
- const curRef = React.useRef(initialValue ?? currentValue);
43
- useIsomorphicInsertionEffect(() => {
44
- curRef.current = currentValue;
45
- });
46
- return React.useCallback(forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current, []);
47
- }
34
+ const curRef = React.useRef(initialValue ?? currentValue);
35
+ useIsomorphicInsertionEffect(() => {
36
+ curRef.current = currentValue;
37
+ });
38
+ return React.useCallback(forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current, []);
39
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __export = (target, all) => {
11
+ for (var name in all) __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
19
+ get: () => from[key],
20
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
21
+ });
22
+ }
23
+ return to;
24
+ };
25
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
+ value: mod,
27
+ enumerable: true
28
+ }) : target, mod));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var useGet_exports = {};
31
+ __export(useGet_exports, { useGet: () => useGet });
32
+ module.exports = __toCommonJS(useGet_exports);
33
+ var React = __toESM(require("react"), 1);
34
+ var useIsomorphicInsertionEffect = React.useInsertionEffect || React.useLayoutEffect;
35
+ function useGet(currentValue, initialValue, forwardToFunction) {
36
+ var curRef = React.useRef(initialValue !== null && initialValue !== void 0 ? initialValue : currentValue);
37
+ useIsomorphicInsertionEffect(function() {
38
+ curRef.current = currentValue;
39
+ });
40
+ return React.useCallback(forwardToFunction ? function() {
41
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
42
+ args[_key] = arguments[_key];
43
+ }
44
+ var _curRef_current;
45
+ return (_curRef_current = curRef.current) === null || _curRef_current === void 0 ? void 0 : _curRef_current.apply(null, args);
46
+ } : function() {
47
+ return curRef.current;
48
+ }, []);
49
+ }
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __create = Object.create;
4
5
  var __defProp = Object.defineProperty;
5
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -7,52 +8,44 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
7
8
  var __getProtoOf = Object.getPrototypeOf;
8
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
10
  var __export = (target, all) => {
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: true
13
- });
11
+ for (var name in all) __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
14
15
  };
15
16
  var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
- get: () => from[key],
19
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
- });
21
- }
22
- return to;
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
19
+ get: () => from[key],
20
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
21
+ });
22
+ }
23
+ return to;
23
24
  };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
- // If the importer is in node compatibility mode or this is not an ESM
26
- // file that has been converted to a CommonJS file using a Babel-
27
- // compatible transform (i.e. "__esModule" has not been set), then set
28
- // "default" to the CommonJS "module.exports" for node compatibility.
29
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30
- value: mod,
31
- enumerable: true
25
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
+ value: mod,
27
+ enumerable: true
32
28
  }) : target, mod));
33
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
34
- value: true
35
- }), mod);
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
30
  var useGet_exports = {};
37
- __export(useGet_exports, {
38
- useGet: () => useGet
39
- });
31
+ __export(useGet_exports, { useGet: () => useGet });
40
32
  module.exports = __toCommonJS(useGet_exports);
41
33
  var React = __toESM(require("react"), 1);
42
34
  var useIsomorphicInsertionEffect = React.useInsertionEffect || React.useLayoutEffect;
43
35
  function useGet(currentValue, initialValue, forwardToFunction) {
44
- var curRef = React.useRef(initialValue !== null && initialValue !== void 0 ? initialValue : currentValue);
45
- useIsomorphicInsertionEffect(function () {
46
- curRef.current = currentValue;
47
- });
48
- return React.useCallback(forwardToFunction ? function () {
49
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
50
- args[_key] = arguments[_key];
51
- }
52
- var _curRef_current;
53
- return (_curRef_current = curRef.current) === null || _curRef_current === void 0 ? void 0 : _curRef_current.apply(null, args);
54
- } : function () {
55
- return curRef.current;
56
- }, []);
36
+ var curRef = React.useRef(initialValue !== null && initialValue !== void 0 ? initialValue : currentValue);
37
+ useIsomorphicInsertionEffect(function() {
38
+ curRef.current = currentValue;
39
+ });
40
+ return React.useCallback(forwardToFunction ? function() {
41
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
42
+ args[_key] = arguments[_key];
43
+ }
44
+ var _curRef_current;
45
+ return (_curRef_current = curRef.current) === null || _curRef_current === void 0 ? void 0 : _curRef_current.apply(null, args);
46
+ } : function() {
47
+ return curRef.current;
48
+ }, []);
57
49
  }
50
+
58
51
  //# sourceMappingURL=useGet.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useGet_exports","__export","useGet","module","exports","React","__toESM","require","useIsomorphicInsertionEffect","useInsertionEffect","useLayoutEffect","currentValue","initialValue","forwardToFunction","curRef","useRef","current","useCallback","_len","arguments","length","args","Array","_key"],"sources":["../../src/useGet.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,cAAA;AAAAC,QAAA,CAAAD,cAAA;EAAAE,MAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAuB,GAAAT,YAAA,CAAAK,cAAA;AAOvB,IAAAK,KAAM,GAAAC,OAAA,CAAAC,OAAA,WAA+B;AAI9B,IAAAC,4BAEL,GAAAH,KAAA,CAAAI,kBACA,IACSJ,KAAA,CAAAK,eAAA;AACT,SAAMR,OAAAS,YAAe,EAAYC,YAAA,EAAAC,iBAA4B;EAC7D,IAAAC,MAAA,GAAAT,KAAA,CAAAU,MAAA,CAAAH,YAAmC,aAAAA,YAAA,cAAAA,YAAA,GAAAD,YAAA;EACjCH,4BAAiB;IAClBM,MAAA,CAAAE,OAAA,GAAAL,YAAA;EAED;EAAa,OACXN,KAAA,CAAAY,WACI,CAAAJ,iBAAoB,eAAS;IAEjC,KAAC,IAAAK,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MACHF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IACF","ignoreList":[]}
1
+ {"version":3,"file":"useGet.native.js","names":[],"sources":["cjs/useGet.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useGet_exports = {};\n__export(useGet_exports, {\n useGet: () => useGet\n});\nmodule.exports = __toCommonJS(useGet_exports);\nvar React = __toESM(require(\"react\"), 1);\nvar useIsomorphicInsertionEffect = React.useInsertionEffect || React.useLayoutEffect;\nfunction useGet(currentValue, initialValue, forwardToFunction) {\n var curRef = React.useRef(initialValue !== null && initialValue !== void 0 ? initialValue : currentValue);\n useIsomorphicInsertionEffect(function() {\n curRef.current = currentValue;\n });\n return React.useCallback(forwardToFunction ? function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var _curRef_current;\n return (_curRef_current = curRef.current) === null || _curRef_current === void 0 ? void 0 : _curRef_current.apply(null, args);\n } : function() {\n return curRef.current;\n }, []);\n}\n//# sourceMappingURL=useGet.js.map\n"],"mappings":";;;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,iBAAiB,CAAC;AACtB,SAAS,gBAAgB,EACvB,cAAc,OAChB,CAAC;AACD,OAAO,UAAU,aAAa,cAAc;AAC5C,IAAI,QAAQ,QAAQ,QAAQ,OAAO,GAAG,CAAC;AACvC,IAAI,+BAA+B,MAAM,sBAAsB,MAAM;AACrE,SAAS,OAAO,cAAc,cAAc,mBAAmB;CAC7D,IAAI,SAAS,MAAM,OAAO,iBAAiB,QAAQ,iBAAiB,KAAK,IAAI,eAAe,YAAY;CACxG,6BAA6B,WAAW;EACtC,OAAO,UAAU;CACnB,CAAC;CACD,OAAO,MAAM,YAAY,oBAAoB,WAAW;EACtD,KAAK,IAAI,OAAO,UAAU,QAAQ,OAAO,IAAI,MAAM,IAAI,GAAG,OAAO,GAAG,OAAO,MAAM,QAAQ;GACvF,KAAK,QAAQ,UAAU;EACzB;EACA,IAAI;EACJ,QAAQ,kBAAkB,OAAO,aAAa,QAAQ,oBAAoB,KAAK,IAAI,KAAK,IAAI,gBAAgB,MAAM,MAAM,IAAI;CAC9H,IAAI,WAAW;EACb,OAAO,OAAO;CAChB,GAAG,CAAC,CAAC;AACP"}
package/dist/esm/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./useEvent.mjs";
2
- export * from "./useGet.mjs";
3
- //# sourceMappingURL=index.js.map
1
+ export * from "./useEvent.mjs"
2
+
3
+ export * from "./useGet.mjs"
@@ -1,3 +1,3 @@
1
- export * from "./useEvent.mjs";
2
- export * from "./useGet.mjs";
3
- //# sourceMappingURL=index.mjs.map
1
+ export * from "./useEvent.mjs"
2
+
3
+ export * from "./useGet.mjs"
@@ -1,3 +1,3 @@
1
- export * from "./useEvent.native.js";
2
- export * from "./useGet.native.js";
3
- //# sourceMappingURL=index.native.js.map
1
+ export * from "./useEvent.native.js"
2
+
3
+ export * from "./useGet.native.js"
@@ -1,9 +1,11 @@
1
1
  import { useGet } from "./useGet.mjs";
2
+
2
3
  function useEvent(callback) {
3
- return useGet(callback, defaultValue, true);
4
+ return useGet(callback, defaultValue, true);
4
5
  }
5
6
  const defaultValue = () => {
6
- throw new Error("Cannot call an event handler while rendering.");
7
+ throw new Error("Cannot call an event handler while rendering.");
7
8
  };
9
+
8
10
  export { useEvent };
9
11
  //# sourceMappingURL=useEvent.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["useGet","useEvent","callback","defaultValue","Error"],"sources":["../../src/useEvent.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,MAAA,QAAc;AAIhB,SAASC,SAAgCC,QAAA,EAAiB;EAC/D,OAAOF,MAAA,CAAOE,QAAA,EAAUC,YAAA,EAAc,IAAI;AAC5C;AAEA,MAAMA,YAAA,GAAeA,CAAA,KAAM;EACzB,MAAM,IAAIC,KAAA,CAAM,+CAA+C;AACjE","ignoreList":[]}
1
+ {"version":3,"file":"useEvent.js","names":[],"sources":["esm/useEvent.js"],"sourcesContent":["import { useGet } from \"./useGet\";\nfunction useEvent(callback) {\n return useGet(callback, defaultValue, true);\n}\nconst defaultValue = () => {\n throw new Error(\"Cannot call an event handler while rendering.\");\n};\nexport {\n useEvent\n};\n//# sourceMappingURL=useEvent.js.map\n"],"mappings":";;;AACA,SAAS,SAAS,UAAU;CAC1B,OAAO,OAAO,UAAU,cAAc,IAAI;AAC5C;AACA,MAAM,qBAAqB;CACzB,MAAM,IAAI,MAAM,+CAA+C;AACjE"}
@@ -1,9 +1,11 @@
1
1
  import { useGet } from "./useGet.native.js";
2
+
2
3
  function useEvent(callback) {
3
- return useGet(callback, defaultValue, true);
4
+ return useGet(callback, defaultValue, true);
4
5
  }
5
- var defaultValue = function () {
6
- throw new Error("Cannot call an event handler while rendering.");
6
+ var defaultValue = function() {
7
+ throw new Error("Cannot call an event handler while rendering.");
7
8
  };
9
+
8
10
  export { useEvent };
9
11
  //# sourceMappingURL=useEvent.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useGet","useEvent","callback","defaultValue","Error"],"sources":["../../src/useEvent.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,MAAA,QAAc;AAIhB,SAASC,SAAgCC,QAAA,EAAiB;EAC/D,OAAOF,MAAA,CAAOE,QAAA,EAAUC,YAAA,EAAc,IAAI;AAC5C;AAEA,IAAAA,YAAM,YAAAA,CAAA,EAAqB;EACzB,MAAM,IAAIC,KAAA,CAAM,+CAA+C;AACjE","ignoreList":[]}
1
+ {"version":3,"file":"useEvent.native.js","names":[],"sources":["esm/useEvent.native.js"],"sourcesContent":["import { useGet } from \"./useGet\";\nfunction useEvent(callback) {\n return useGet(callback, defaultValue, true);\n}\nvar defaultValue = function() {\n throw new Error(\"Cannot call an event handler while rendering.\");\n};\nexport {\n useEvent\n};\n//# sourceMappingURL=useEvent.js.map\n"],"mappings":";;;AACA,SAAS,SAAS,UAAU;CAC1B,OAAO,OAAO,UAAU,cAAc,IAAI;AAC5C;AACA,IAAI,eAAe,WAAW;CAC5B,MAAM,IAAI,MAAM,+CAA+C;AACjE"}
@@ -1,11 +1,13 @@
1
1
  import * as React from "react";
2
+
2
3
  const useIsomorphicInsertionEffect = React.useInsertionEffect || React.useLayoutEffect;
3
4
  function useGet(currentValue, initialValue, forwardToFunction) {
4
- const curRef = React.useRef(initialValue ?? currentValue);
5
- useIsomorphicInsertionEffect(() => {
6
- curRef.current = currentValue;
7
- });
8
- return React.useCallback(forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current, []);
5
+ const curRef = React.useRef(initialValue ?? currentValue);
6
+ useIsomorphicInsertionEffect(() => {
7
+ curRef.current = currentValue;
8
+ });
9
+ return React.useCallback(forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current, []);
9
10
  }
11
+
10
12
  export { useGet };
11
13
  //# sourceMappingURL=useGet.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useIsomorphicInsertionEffect","useInsertionEffect","useLayoutEffect","useGet","currentValue","initialValue","forwardToFunction","curRef","useRef","current","useCallback","args","apply"],"sources":["../../src/useGet.ts"],"sourcesContent":[null],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAOvB,MAAMC,4BAAA,GAA+BD,KAAA,CAAME,kBAAA,IAAsBF,KAAA,CAAMG,eAAA;AAIhE,SAASC,OACdC,YAAA,EACAC,YAAA,EACAC,iBAAA,EACS;EACT,MAAMC,MAAA,GAASR,KAAA,CAAMS,MAAA,CAAYH,YAAA,IAAgBD,YAAY;EAC7DJ,4BAAA,CAA6B,MAAM;IACjCO,MAAA,CAAOE,OAAA,GAAUL,YAAA;EACnB,CAAC;EAED,OAAOL,KAAA,CAAMW,WAAA,CACXJ,iBAAA,GACI,IAAIK,IAAA,KAASJ,MAAA,CAAOE,OAAA,EAASG,KAAA,CAAM,MAAMD,IAAI,IAC7C,MAAMJ,MAAA,CAAOE,OAAA,EACjB,EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"useGet.js","names":[],"sources":["esm/useGet.js"],"sourcesContent":["import * as React from \"react\";\nconst useIsomorphicInsertionEffect = React.useInsertionEffect || React.useLayoutEffect;\nfunction useGet(currentValue, initialValue, forwardToFunction) {\n const curRef = React.useRef(initialValue ?? currentValue);\n useIsomorphicInsertionEffect(() => {\n curRef.current = currentValue;\n });\n return React.useCallback(\n forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current,\n []\n );\n}\nexport {\n useGet\n};\n//# sourceMappingURL=useGet.js.map\n"],"mappings":";;;AACA,MAAM,+BAA+B,MAAM,sBAAsB,MAAM;AACvE,SAAS,OAAO,cAAc,cAAc,mBAAmB;CAC7D,MAAM,SAAS,MAAM,OAAO,gBAAgB,YAAY;CACxD,mCAAmC;EACjC,OAAO,UAAU;CACnB,CAAC;CACD,OAAO,MAAM,YACX,qBAAqB,GAAG,SAAS,OAAO,SAAS,MAAM,MAAM,IAAI,UAAU,OAAO,SAClF,CAAC,CACH;AACF"}
@@ -1,19 +1,21 @@
1
1
  import * as React from "react";
2
+
2
3
  var useIsomorphicInsertionEffect = React.useInsertionEffect || React.useLayoutEffect;
3
4
  function useGet(currentValue, initialValue, forwardToFunction) {
4
- var curRef = React.useRef(initialValue !== null && initialValue !== void 0 ? initialValue : currentValue);
5
- useIsomorphicInsertionEffect(function () {
6
- curRef.current = currentValue;
7
- });
8
- return React.useCallback(forwardToFunction ? function () {
9
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
10
- args[_key] = arguments[_key];
11
- }
12
- var _curRef_current;
13
- return (_curRef_current = curRef.current) === null || _curRef_current === void 0 ? void 0 : _curRef_current.apply(null, args);
14
- } : function () {
15
- return curRef.current;
16
- }, []);
5
+ var curRef = React.useRef(initialValue !== null && initialValue !== void 0 ? initialValue : currentValue);
6
+ useIsomorphicInsertionEffect(function() {
7
+ curRef.current = currentValue;
8
+ });
9
+ return React.useCallback(forwardToFunction ? function() {
10
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11
+ args[_key] = arguments[_key];
12
+ }
13
+ var _curRef_current;
14
+ return (_curRef_current = curRef.current) === null || _curRef_current === void 0 ? void 0 : _curRef_current.apply(null, args);
15
+ } : function() {
16
+ return curRef.current;
17
+ }, []);
17
18
  }
19
+
18
20
  export { useGet };
19
21
  //# sourceMappingURL=useGet.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useIsomorphicInsertionEffect","useInsertionEffect","useLayoutEffect","useGet","currentValue","initialValue","forwardToFunction","curRef","useRef","current","useCallback","_len","arguments","length","args","Array","_key","_curRef_current"],"sources":["../../src/useGet.ts"],"sourcesContent":[null],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAOvB,IAAAC,4BAAM,GAAAD,KAA+B,CAAAE,kBAAM,IAAAF,KAAsB,CAAAG,eAAM;AAIhE,SAASC,OACdC,YAAA,EACAC,YAAA,EACAC,iBAAA,EACS;EACT,IAAAC,MAAM,GAAAR,KAAS,CAAAS,MAAM,CAAAH,YAAY,SAAgB,IAAAA,YAAY,cAAAA,YAAA,GAAAD,YAAA;EAC7DJ,4BAAA,CAA6B,YAAM;IACjCO,MAAA,CAAOE,OAAA,GAAUL,YAAA;EACnB,CAAC;EAED,OAAOL,KAAA,CAAMW,WAAA,CAAAJ,iBAAA;IACX,SAAAK,IAAA,GAAAC,SACQ,CAAAC,MAAA,EAASC,IAAA,GAAO,IAAAC,KAAS,CAAAJ,IAAM,GAAAK,IAAM,GAAI,GAAAA,IAC7C,GAAML,IAAA,EAAAK,IAAO;MAChBF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IACH;IACF,IAAAC,eAAA","ignoreList":[]}
1
+ {"version":3,"file":"useGet.native.js","names":[],"sources":["esm/useGet.native.js"],"sourcesContent":["import * as React from \"react\";\nvar useIsomorphicInsertionEffect = React.useInsertionEffect || React.useLayoutEffect;\nfunction useGet(currentValue, initialValue, forwardToFunction) {\n var curRef = React.useRef(initialValue !== null && initialValue !== void 0 ? initialValue : currentValue);\n useIsomorphicInsertionEffect(function() {\n curRef.current = currentValue;\n });\n return React.useCallback(forwardToFunction ? function() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var _curRef_current;\n return (_curRef_current = curRef.current) === null || _curRef_current === void 0 ? void 0 : _curRef_current.apply(null, args);\n } : function() {\n return curRef.current;\n }, []);\n}\nexport {\n useGet\n};\n//# sourceMappingURL=useGet.js.map\n"],"mappings":";;;AACA,IAAI,+BAA+B,MAAM,sBAAsB,MAAM;AACrE,SAAS,OAAO,cAAc,cAAc,mBAAmB;CAC7D,IAAI,SAAS,MAAM,OAAO,iBAAiB,QAAQ,iBAAiB,KAAK,IAAI,eAAe,YAAY;CACxG,6BAA6B,WAAW;EACtC,OAAO,UAAU;CACnB,CAAC;CACD,OAAO,MAAM,YAAY,oBAAoB,WAAW;EACtD,KAAK,IAAI,OAAO,UAAU,QAAQ,OAAO,IAAI,MAAM,IAAI,GAAG,OAAO,GAAG,OAAO,MAAM,QAAQ;GACvF,KAAK,QAAQ,UAAU;EACzB;EACA,IAAI;EACJ,QAAQ,kBAAkB,OAAO,aAAa,QAAQ,oBAAoB,KAAK,IAAI,KAAK,IAAI,gBAAgB,MAAM,MAAM,IAAI;CAC9H,IAAI,WAAW;EACb,OAAO,OAAO;CAChB,GAAG,CAAC,CAAC;AACP"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/use-event",
3
- "version": "2.7.7",
3
+ "version": "3.0.0-beta.643.1",
4
4
  "files": [
5
5
  "src",
6
6
  "types",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {},
36
36
  "devDependencies": {
37
- "@tamagui/build": "2.7.7",
37
+ "@tamagui/build": "3.0.0-beta.643.1",
38
38
  "react": ">=19"
39
39
  },
40
40
  "peerDependencies": {
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc","ignoreList":[]}