@tamagui/use-event 1.88.0 → 1.88.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 +0 -5
- package/dist/cjs/useEvent.js +0 -4
- package/dist/cjs/useGet.js +1 -8
- package/dist/cjs/useGet.js.map +1 -1
- package/dist/esm/index.native.js +21 -2
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/useEvent.native.js +25 -4
- package/dist/esm/useEvent.native.js.map +1 -1
- package/dist/esm/useGet.native.js +31 -8
- package/dist/esm/useGet.native.js.map +1 -1
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -13,9 +13,4 @@ var src_exports = {};
|
|
|
13
13
|
module.exports = __toCommonJS(src_exports);
|
|
14
14
|
__reExport(src_exports, require("./useEvent"), module.exports);
|
|
15
15
|
__reExport(src_exports, require("./useGet"), module.exports);
|
|
16
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
17
|
-
0 && (module.exports = {
|
|
18
|
-
...require("./useEvent"),
|
|
19
|
-
...require("./useGet")
|
|
20
|
-
});
|
|
21
16
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/useEvent.js
CHANGED
|
@@ -24,8 +24,4 @@ function useEvent(callback) {
|
|
|
24
24
|
const defaultValue = () => {
|
|
25
25
|
throw new Error("Cannot call an event handler while rendering.");
|
|
26
26
|
};
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
useEvent
|
|
30
|
-
});
|
|
31
27
|
//# sourceMappingURL=useEvent.js.map
|
package/dist/cjs/useGet.js
CHANGED
|
@@ -23,15 +23,8 @@ function useGet(currentValue, initialValue, forwardToFunction) {
|
|
|
23
23
|
return (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
24
24
|
curRef.current = currentValue;
|
|
25
25
|
}), (0, import_react.useCallback)(
|
|
26
|
-
forwardToFunction ? (...args) =>
|
|
27
|
-
var _a;
|
|
28
|
-
return (_a = curRef.current) == null ? void 0 : _a.apply(null, args);
|
|
29
|
-
} : () => curRef.current,
|
|
26
|
+
forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current,
|
|
30
27
|
[]
|
|
31
28
|
);
|
|
32
29
|
}
|
|
33
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
-
0 && (module.exports = {
|
|
35
|
-
useGet
|
|
36
|
-
});
|
|
37
30
|
//# sourceMappingURL=useGet.js.map
|
package/dist/cjs/useGet.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useGet.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0C,+BAC1C,eAAoC;AAI7B,SAAS,OACd,cACA,cACA,mBACS;AACT,QAAM,aAAS,qBAAY,gBAAgB,YAAY;AACvD,yDAA0B,MAAM;AAC9B,WAAO,UAAU;AAAA,EACnB,CAAC,OAEM;AAAA,IACL,oBACI,IAAI,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0C,+BAC1C,eAAoC;AAI7B,SAAS,OACd,cACA,cACA,mBACS;AACT,QAAM,aAAS,qBAAY,gBAAgB,YAAY;AACvD,yDAA0B,MAAM;AAC9B,WAAO,UAAU;AAAA,EACnB,CAAC,OAEM;AAAA,IACL,oBACI,IAAI,SAAS,OAAO,SAAS,MAAM,MAAM,IAAI,IAC7C,MAAM,OAAO;AAAA,IACjB,CAAC;AAAA,EACH;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
!__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
|
+
});
|
|
3
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,32 @@
|
|
|
1
|
-
|
|
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: !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");
|
|
2
22
|
function useEvent(callback) {
|
|
3
|
-
return useGet(callback, defaultValue, !0);
|
|
23
|
+
return (0, import_useGet.useGet)(callback, defaultValue, !0);
|
|
4
24
|
}
|
|
5
25
|
const defaultValue = () => {
|
|
6
26
|
throw new Error("Cannot call an event handler while rendering.");
|
|
7
27
|
};
|
|
8
|
-
export
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
9
30
|
useEvent
|
|
10
|
-
};
|
|
31
|
+
});
|
|
11
32
|
//# sourceMappingURL=useEvent.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useEvent.ts"],
|
|
4
|
-
"mappings": "AAAA,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AAIhB,SAAS,SAAgC,UAAiB;AAC/D,aAAO,sBAAO,UAAU,cAAc,EAAI;AAC5C;AAEA,MAAM,eAAe,MAAM;AACzB,QAAM,IAAI,MAAM,+CAA+C;AACjE;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,15 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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: !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");
|
|
3
22
|
function useGet(currentValue, initialValue, forwardToFunction) {
|
|
4
|
-
const curRef = useRef(initialValue ?? currentValue);
|
|
5
|
-
return useIsomorphicLayoutEffect(() => {
|
|
23
|
+
const curRef = (0, import_react.useRef)(initialValue ?? currentValue);
|
|
24
|
+
return (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
6
25
|
curRef.current = currentValue;
|
|
7
|
-
}), useCallback(
|
|
8
|
-
forwardToFunction ? (...args) =>
|
|
26
|
+
}), (0, import_react.useCallback)(
|
|
27
|
+
forwardToFunction ? (...args) => {
|
|
28
|
+
var _a;
|
|
29
|
+
return (_a = curRef.current) == null ? void 0 : _a.apply(null, args);
|
|
30
|
+
} : () => curRef.current,
|
|
9
31
|
[]
|
|
10
32
|
);
|
|
11
33
|
}
|
|
12
|
-
export
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
13
36
|
useGet
|
|
14
|
-
};
|
|
37
|
+
});
|
|
15
38
|
//# sourceMappingURL=useGet.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useGet.ts"],
|
|
4
|
-
"mappings": "AAAA
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0C,+BAC1C,eAAoC;AAI7B,SAAS,OACd,cACA,cACA,mBACS;AACT,QAAM,aAAS,qBAAY,gBAAgB,YAAY;AACvD,yDAA0B,MAAM;AAC9B,WAAO,UAAU;AAAA,EACnB,CAAC,OAEM;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.2",
|
|
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.2",
|
|
22
22
|
"react": "^18.2.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@tamagui/constants": "1.88.
|
|
25
|
+
"@tamagui/constants": "1.88.2"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "*"
|