@tamagui/use-event 1.14.1 → 1.14.2

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.js CHANGED
@@ -1,2 +1,20 @@
1
- "use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(r,o,p,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let m of c(o))!d.call(r,m)&&m!==p&&a(r,m,{get:()=>o[m],enumerable:!(x=b(o,m))||x.enumerable});return r},f=(r,o,p)=>(t(r,o,"default"),p&&t(p,o,"default"));var g=r=>t(a({},"__esModule",{value:!0}),r);var e={};module.exports=g(e);f(e,require("./useEvent"),module.exports);f(e,require("./useGet"),module.exports);
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
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
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var src_exports = {};
17
+ module.exports = __toCommonJS(src_exports);
18
+ __reExport(src_exports, require("./useEvent"), module.exports);
19
+ __reExport(src_exports, require("./useGet"), module.exports);
2
20
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
4
  "sourcesContent": ["export * from './useEvent'\nexport * from './useGet'\n"],
5
- "mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAAE,EAAAF,EAAc,sBAAd,gBACAE,EAAAF,EAAc,oBADd",
6
- "names": ["src_exports", "__toCommonJS", "__reExport"]
5
+ "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,uBAAd;AACA,wBAAc,qBADd;",
6
+ "names": []
7
7
  }
@@ -1,2 +1,35 @@
1
- "use strict";var a=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var c=(n,e)=>{for(var r in e)a(n,r,{get:e[r],enumerable:!0})},y=(n,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of l(e))!s.call(n,t)&&t!==r&&a(n,t,{get:()=>e[t],enumerable:!(o=i(e,t))||o.enumerable});return n};var d=n=>y(a({},"__esModule",{value:!0}),n);var h={};c(h,{useEvent:()=>T});module.exports=d(h);var u=require("./useGet");function T(n){return(0,u.useGet)(n,f,!0)}const f=()=>{throw new Error("Cannot call an event handler while rendering.")};0&&(module.exports={useEvent});
1
+ "use strict";
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: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var useEvent_exports = {};
20
+ __export(useEvent_exports, {
21
+ useEvent: () => useEvent
22
+ });
23
+ module.exports = __toCommonJS(useEvent_exports);
24
+ var import_useGet = require("./useGet");
25
+ function useEvent(callback) {
26
+ return (0, import_useGet.useGet)(callback, defaultValue, true);
27
+ }
28
+ const defaultValue = () => {
29
+ throw new Error("Cannot call an event handler while rendering.");
30
+ };
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ useEvent
34
+ });
2
35
  //# sourceMappingURL=useEvent.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/useEvent.ts"],
4
4
  "sourcesContent": ["import { useGet } from './useGet'\n\ntype AnyFunction = (...args: any[]) => any\n\nexport function useEvent<T extends AnyFunction>(callback?: T): T {\n return useGet(callback, defaultValue, true) as T\n}\n\nconst defaultValue = () => {\n throw new Error('Cannot call an event handler while rendering.')\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBAIhB,SAASF,EAAgCG,EAAiB,CAC/D,SAAO,UAAOA,EAAUC,EAAc,EAAI,CAC5C,CAEA,MAAMA,EAAe,IAAM,CACzB,MAAM,IAAI,MAAM,+CAA+C,CACjE",
6
- "names": ["useEvent_exports", "__export", "useEvent", "__toCommonJS", "import_useGet", "callback", "defaultValue"]
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AAIhB,SAAS,SAAgC,UAAiB;AAC/D,aAAO,sBAAO,UAAU,cAAc,IAAI;AAC5C;AAEA,MAAM,eAAe,MAAM;AACzB,QAAM,IAAI,MAAM,+CAA+C;AACjE;",
6
+ "names": []
7
7
  }
@@ -1,2 +1,45 @@
1
- "use strict";var u=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var p=(n,e)=>{for(var s in e)u(n,s,{get:e[s],enumerable:!0})},l=(n,e,s,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of i(e))!a.call(n,o)&&o!==s&&u(n,o,{get:()=>e[o],enumerable:!(c=r(e,o))||c.enumerable});return n};var y=n=>l(u({},"__esModule",{value:!0}),n);var m={};p(m,{useGet:()=>d});module.exports=y(m);var t=require("react");const A=process.env.TAMAGUI_TARGET==="web",b=typeof window<"u",E=!A||b?t.useLayoutEffect:t.useEffect;function d(n,e,s){const c=(0,t.useRef)(e??n);return E(()=>{c.current=n}),(0,t.useCallback)(s?(...o)=>{var f;return(f=c.current)==null?void 0:f.apply(null,o)}:()=>c.current,[])}0&&(module.exports={useGet});
1
+ "use strict";
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: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var useGet_exports = {};
20
+ __export(useGet_exports, {
21
+ useGet: () => useGet
22
+ });
23
+ module.exports = __toCommonJS(useGet_exports);
24
+ var import_react = require("react");
25
+ const isWeb = process.env.TAMAGUI_TARGET === "web";
26
+ const isClient = typeof window !== "undefined";
27
+ const useIsomorphicLayoutEffect = !isWeb || isClient ? import_react.useLayoutEffect : import_react.useEffect;
28
+ function useGet(currentValue, initialValue, forwardToFunction) {
29
+ const curRef = (0, import_react.useRef)(initialValue ?? currentValue);
30
+ useIsomorphicLayoutEffect(() => {
31
+ curRef.current = currentValue;
32
+ });
33
+ return (0, import_react.useCallback)(
34
+ forwardToFunction ? (...args) => {
35
+ var _a;
36
+ return (_a = curRef.current) == null ? void 0 : _a.apply(null, args);
37
+ } : () => curRef.current,
38
+ []
39
+ );
40
+ }
41
+ // Annotate the CommonJS export names for ESM import in node:
42
+ 0 && (module.exports = {
43
+ useGet
44
+ });
2
45
  //# sourceMappingURL=useGet.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/useGet.ts"],
4
4
  "sourcesContent": ["import { useCallback, useEffect, useLayoutEffect, useRef } from 'react'\n\nconst isWeb = process.env.TAMAGUI_TARGET === 'web'\nconst isClient = typeof window !== 'undefined'\nconst useIsomorphicLayoutEffect = !isWeb || isClient ? useLayoutEffect : useEffect\n\n// keeps a reference to the current value easily\n\nexport function useGet<A>(\n currentValue: A,\n initialValue?: any,\n forwardToFunction?: boolean,\n): () => A {\n const curRef = useRef<any>(initialValue ?? currentValue)\n useIsomorphicLayoutEffect(() => {\n curRef.current = currentValue\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useCallback(\n forwardToFunction\n ? (...args) => curRef.current?.apply(null, args)\n : () => curRef.current,\n [],\n )\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgE,iBAEhE,MAAMC,EAAQ,QAAQ,IAAI,iBAAmB,MACvCC,EAAW,OAAO,OAAW,IAC7BC,EAA4B,CAACF,GAASC,EAAW,kBAAkB,YAIlE,SAASJ,EACdM,EACAC,EACAC,EACS,CACT,MAAMC,KAAS,UAAYF,GAAgBD,CAAY,EACvD,OAAAD,EAA0B,IAAM,CAC9BI,EAAO,QAAUH,CACnB,CAAC,KAEM,eACLE,EACI,IAAIE,IAAM,CApBlB,IAAAC,EAoBqB,OAAAA,EAAAF,EAAO,UAAP,YAAAE,EAAgB,MAAM,KAAMD,IACzC,IAAMD,EAAO,QACjB,CAAC,CACH,CACF",
6
- "names": ["useGet_exports", "__export", "useGet", "__toCommonJS", "import_react", "isWeb", "isClient", "useIsomorphicLayoutEffect", "currentValue", "initialValue", "forwardToFunction", "curRef", "args", "_a"]
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAgE;AAEhE,MAAM,QAAQ,QAAQ,IAAI,mBAAmB;AAC7C,MAAM,WAAW,OAAO,WAAW;AACnC,MAAM,4BAA4B,CAAC,SAAS,WAAW,+BAAkB;AAIlE,SAAS,OACd,cACA,cACA,mBACS;AACT,QAAM,aAAS,qBAAY,gBAAgB,YAAY;AACvD,4BAA0B,MAAM;AAC9B,WAAO,UAAU;AAAA,EACnB,CAAC;AAED,aAAO;AAAA,IACL,oBACI,IAAI,SAAM;AApBlB;AAoBqB,0BAAO,YAAP,mBAAgB,MAAM,MAAM;AAAA,QACzC,MAAM,OAAO;AAAA,IACjB,CAAC;AAAA,EACH;AACF;",
6
+ "names": []
7
7
  }
package/dist/esm/index.js CHANGED
@@ -1,2 +1,3 @@
1
- export*from"./useEvent";export*from"./useGet";
1
+ export * from "./useEvent";
2
+ export * from "./useGet";
2
3
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
4
  "sourcesContent": ["export * from './useEvent'\nexport * from './useGet'\n"],
5
- "mappings": "AAAA,WAAc,aACd,WAAc",
5
+ "mappings": "AAAA,cAAc;AACd,cAAc;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,3 @@
1
- export*from"./useEvent";export*from"./useGet";
1
+ export * from "./useEvent";
2
+ export * from "./useGet";
2
3
  //# sourceMappingURL=index.mjs.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
4
  "sourcesContent": ["export * from './useEvent'\nexport * from './useGet'\n"],
5
- "mappings": "AAAA,WAAc,aACd,WAAc",
5
+ "mappings": "AAAA,cAAc;AACd,cAAc;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,11 @@
1
- import{useGet as e}from"./useGet";function a(n){return e(n,t,!0)}const t=()=>{throw new Error("Cannot call an event handler while rendering.")};export{a as useEvent};
1
+ import { useGet } from "./useGet";
2
+ function useEvent(callback) {
3
+ return useGet(callback, defaultValue, true);
4
+ }
5
+ const defaultValue = () => {
6
+ throw new Error("Cannot call an event handler while rendering.");
7
+ };
8
+ export {
9
+ useEvent
10
+ };
2
11
  //# sourceMappingURL=useEvent.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/useEvent.ts"],
4
4
  "sourcesContent": ["import { useGet } from './useGet'\n\ntype AnyFunction = (...args: any[]) => any\n\nexport function useEvent<T extends AnyFunction>(callback?: T): T {\n return useGet(callback, defaultValue, true) as T\n}\n\nconst defaultValue = () => {\n throw new Error('Cannot call an event handler while rendering.')\n}\n"],
5
- "mappings": "AAAA,OAAS,UAAAA,MAAc,WAIhB,SAASC,EAAgCC,EAAiB,CAC/D,OAAOF,EAAOE,EAAUC,EAAc,EAAI,CAC5C,CAEA,MAAMA,EAAe,IAAM,CACzB,MAAM,IAAI,MAAM,+CAA+C,CACjE",
6
- "names": ["useGet", "useEvent", "callback", "defaultValue"]
5
+ "mappings": "AAAA,SAAS,cAAc;AAIhB,SAAS,SAAgC,UAAiB;AAC/D,SAAO,OAAO,UAAU,cAAc,IAAI;AAC5C;AAEA,MAAM,eAAe,MAAM;AACzB,QAAM,IAAI,MAAM,+CAA+C;AACjE;",
6
+ "names": []
7
7
  }
@@ -1,2 +1,11 @@
1
- import{useGet as e}from"./useGet";function a(n){return e(n,t,!0)}const t=()=>{throw new Error("Cannot call an event handler while rendering.")};export{a as useEvent};
1
+ import { useGet } from "./useGet";
2
+ function useEvent(callback) {
3
+ return useGet(callback, defaultValue, true);
4
+ }
5
+ const defaultValue = () => {
6
+ throw new Error("Cannot call an event handler while rendering.");
7
+ };
8
+ export {
9
+ useEvent
10
+ };
2
11
  //# sourceMappingURL=useEvent.mjs.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/useEvent.ts"],
4
4
  "sourcesContent": ["import { useGet } from './useGet'\n\ntype AnyFunction = (...args: any[]) => any\n\nexport function useEvent<T extends AnyFunction>(callback?: T): T {\n return useGet(callback, defaultValue, true) as T\n}\n\nconst defaultValue = () => {\n throw new Error('Cannot call an event handler while rendering.')\n}\n"],
5
- "mappings": "AAAA,OAAS,UAAAA,MAAc,WAIhB,SAASC,EAAgCC,EAAiB,CAC/D,OAAOF,EAAOE,EAAUC,EAAc,EAAI,CAC5C,CAEA,MAAMA,EAAe,IAAM,CACzB,MAAM,IAAI,MAAM,+CAA+C,CACjE",
6
- "names": ["useGet", "useEvent", "callback", "defaultValue"]
5
+ "mappings": "AAAA,SAAS,cAAc;AAIhB,SAAS,SAAgC,UAAiB;AAC/D,SAAO,OAAO,UAAU,cAAc,IAAI;AAC5C;AAEA,MAAM,eAAe,MAAM;AACzB,QAAM,IAAI,MAAM,+CAA+C;AACjE;",
6
+ "names": []
7
7
  }
@@ -1,2 +1,21 @@
1
- import{useCallback as u,useEffect as f,useLayoutEffect as r,useRef as i}from"react";const a=process.env.TAMAGUI_TARGET==="web",p=typeof window<"u",l=!a||p?r:f;function A(n,o,s){const e=i(o??n);return l(()=>{e.current=n}),u(s?(...c)=>{var t;return(t=e.current)==null?void 0:t.apply(null,c)}:()=>e.current,[])}export{A as useGet};
1
+ import { useCallback, useEffect, useLayoutEffect, useRef } from "react";
2
+ const isWeb = process.env.TAMAGUI_TARGET === "web";
3
+ const isClient = typeof window !== "undefined";
4
+ const useIsomorphicLayoutEffect = !isWeb || isClient ? useLayoutEffect : useEffect;
5
+ function useGet(currentValue, initialValue, forwardToFunction) {
6
+ const curRef = useRef(initialValue ?? currentValue);
7
+ useIsomorphicLayoutEffect(() => {
8
+ curRef.current = currentValue;
9
+ });
10
+ return useCallback(
11
+ forwardToFunction ? (...args) => {
12
+ var _a;
13
+ return (_a = curRef.current) == null ? void 0 : _a.apply(null, args);
14
+ } : () => curRef.current,
15
+ []
16
+ );
17
+ }
18
+ export {
19
+ useGet
20
+ };
2
21
  //# sourceMappingURL=useGet.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/useGet.ts"],
4
4
  "sourcesContent": ["import { useCallback, useEffect, useLayoutEffect, useRef } from 'react'\n\nconst isWeb = process.env.TAMAGUI_TARGET === 'web'\nconst isClient = typeof window !== 'undefined'\nconst useIsomorphicLayoutEffect = !isWeb || isClient ? useLayoutEffect : useEffect\n\n// keeps a reference to the current value easily\n\nexport function useGet<A>(\n currentValue: A,\n initialValue?: any,\n forwardToFunction?: boolean,\n): () => A {\n const curRef = useRef<any>(initialValue ?? currentValue)\n useIsomorphicLayoutEffect(() => {\n curRef.current = currentValue\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useCallback(\n forwardToFunction\n ? (...args) => curRef.current?.apply(null, args)\n : () => curRef.current,\n [],\n )\n}\n"],
5
- "mappings": "AAAA,OAAS,eAAAA,EAAa,aAAAC,EAAW,mBAAAC,EAAiB,UAAAC,MAAc,QAEhE,MAAMC,EAAQ,QAAQ,IAAI,iBAAmB,MACvCC,EAAW,OAAO,OAAW,IAC7BC,EAA4B,CAACF,GAASC,EAAWH,EAAkBD,EAIlE,SAASM,EACdC,EACAC,EACAC,EACS,CACT,MAAMC,EAASR,EAAYM,GAAgBD,CAAY,EACvD,OAAAF,EAA0B,IAAM,CAC9BK,EAAO,QAAUH,CACnB,CAAC,EAEMR,EACLU,EACI,IAAIE,IAAM,CApBlB,IAAAC,EAoBqB,OAAAA,EAAAF,EAAO,UAAP,YAAAE,EAAgB,MAAM,KAAMD,IACzC,IAAMD,EAAO,QACjB,CAAC,CACH,CACF",
6
- "names": ["useCallback", "useEffect", "useLayoutEffect", "useRef", "isWeb", "isClient", "useIsomorphicLayoutEffect", "useGet", "currentValue", "initialValue", "forwardToFunction", "curRef", "args", "_a"]
5
+ "mappings": "AAAA,SAAS,aAAa,WAAW,iBAAiB,cAAc;AAEhE,MAAM,QAAQ,QAAQ,IAAI,mBAAmB;AAC7C,MAAM,WAAW,OAAO,WAAW;AACnC,MAAM,4BAA4B,CAAC,SAAS,WAAW,kBAAkB;AAIlE,SAAS,OACd,cACA,cACA,mBACS;AACT,QAAM,SAAS,OAAY,gBAAgB,YAAY;AACvD,4BAA0B,MAAM;AAC9B,WAAO,UAAU;AAAA,EACnB,CAAC;AAED,SAAO;AAAA,IACL,oBACI,IAAI,SAAM;AApBlB;AAoBqB,0BAAO,YAAP,mBAAgB,MAAM,MAAM;AAAA,QACzC,MAAM,OAAO;AAAA,IACjB,CAAC;AAAA,EACH;AACF;",
6
+ "names": []
7
7
  }
@@ -1,2 +1,21 @@
1
- import{useCallback as u,useEffect as f,useLayoutEffect as r,useRef as i}from"react";const a=process.env.TAMAGUI_TARGET==="web",p=typeof window<"u",l=!a||p?r:f;function A(n,o,s){const e=i(o??n);return l(()=>{e.current=n}),u(s?(...c)=>{var t;return(t=e.current)==null?void 0:t.apply(null,c)}:()=>e.current,[])}export{A as useGet};
1
+ import { useCallback, useEffect, useLayoutEffect, useRef } from "react";
2
+ const isWeb = process.env.TAMAGUI_TARGET === "web";
3
+ const isClient = typeof window !== "undefined";
4
+ const useIsomorphicLayoutEffect = !isWeb || isClient ? useLayoutEffect : useEffect;
5
+ function useGet(currentValue, initialValue, forwardToFunction) {
6
+ const curRef = useRef(initialValue ?? currentValue);
7
+ useIsomorphicLayoutEffect(() => {
8
+ curRef.current = currentValue;
9
+ });
10
+ return useCallback(
11
+ forwardToFunction ? (...args) => {
12
+ var _a;
13
+ return (_a = curRef.current) == null ? void 0 : _a.apply(null, args);
14
+ } : () => curRef.current,
15
+ []
16
+ );
17
+ }
18
+ export {
19
+ useGet
20
+ };
2
21
  //# sourceMappingURL=useGet.mjs.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/useGet.ts"],
4
4
  "sourcesContent": ["import { useCallback, useEffect, useLayoutEffect, useRef } from 'react'\n\nconst isWeb = process.env.TAMAGUI_TARGET === 'web'\nconst isClient = typeof window !== 'undefined'\nconst useIsomorphicLayoutEffect = !isWeb || isClient ? useLayoutEffect : useEffect\n\n// keeps a reference to the current value easily\n\nexport function useGet<A>(\n currentValue: A,\n initialValue?: any,\n forwardToFunction?: boolean,\n): () => A {\n const curRef = useRef<any>(initialValue ?? currentValue)\n useIsomorphicLayoutEffect(() => {\n curRef.current = currentValue\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useCallback(\n forwardToFunction\n ? (...args) => curRef.current?.apply(null, args)\n : () => curRef.current,\n [],\n )\n}\n"],
5
- "mappings": "AAAA,OAAS,eAAAA,EAAa,aAAAC,EAAW,mBAAAC,EAAiB,UAAAC,MAAc,QAEhE,MAAMC,EAAQ,QAAQ,IAAI,iBAAmB,MACvCC,EAAW,OAAO,OAAW,IAC7BC,EAA4B,CAACF,GAASC,EAAWH,EAAkBD,EAIlE,SAASM,EACdC,EACAC,EACAC,EACS,CACT,MAAMC,EAASR,EAAYM,GAAgBD,CAAY,EACvD,OAAAF,EAA0B,IAAM,CAC9BK,EAAO,QAAUH,CACnB,CAAC,EAEMR,EACLU,EACI,IAAIE,IAAM,CApBlB,IAAAC,EAoBqB,OAAAA,EAAAF,EAAO,UAAP,YAAAE,EAAgB,MAAM,KAAMD,IACzC,IAAMD,EAAO,QACjB,CAAC,CACH,CACF",
6
- "names": ["useCallback", "useEffect", "useLayoutEffect", "useRef", "isWeb", "isClient", "useIsomorphicLayoutEffect", "useGet", "currentValue", "initialValue", "forwardToFunction", "curRef", "args", "_a"]
5
+ "mappings": "AAAA,SAAS,aAAa,WAAW,iBAAiB,cAAc;AAEhE,MAAM,QAAQ,QAAQ,IAAI,mBAAmB;AAC7C,MAAM,WAAW,OAAO,WAAW;AACnC,MAAM,4BAA4B,CAAC,SAAS,WAAW,kBAAkB;AAIlE,SAAS,OACd,cACA,cACA,mBACS;AACT,QAAM,SAAS,OAAY,gBAAgB,YAAY;AACvD,4BAA0B,MAAM;AAC9B,WAAO,UAAU;AAAA,EACnB,CAAC;AAED,SAAO;AAAA,IACL,oBACI,IAAI,SAAM;AApBlB;AAoBqB,0BAAO,YAAP,mBAAgB,MAAM,MAAM;AAAA,QACzC,MAAM,OAAO;AAAA,IACjB,CAAC;AAAA,EACH;AACF;",
6
+ "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/use-event",
3
- "version": "1.14.1",
3
+ "version": "1.14.2",
4
4
  "types": "./types/index.d.ts",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -18,7 +18,7 @@
18
18
  "clean:build": "tamagui-build clean:build"
19
19
  },
20
20
  "devDependencies": {
21
- "@tamagui/build": "1.14.1",
21
+ "@tamagui/build": "1.14.2",
22
22
  "react": "^18.2.0"
23
23
  },
24
24
  "peerDependencies": {