@tamagui/use-force-update 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 +36 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/index.js +11 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/index.mjs +11 -1
- package/dist/esm/index.mjs.map +2 -2
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
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 src_exports = {};
|
|
20
|
+
__export(src_exports, {
|
|
21
|
+
isServerSide: () => isServerSide,
|
|
22
|
+
useForceUpdate: () => useForceUpdate
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(src_exports);
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
const isServerSide = process.env.TAMAGUI_TARGET === "web" && typeof window === "undefined";
|
|
27
|
+
const idFn = () => {
|
|
28
|
+
};
|
|
29
|
+
function useForceUpdate() {
|
|
30
|
+
return isServerSide ? idFn : (0, import_react.useReducer)((x) => x + 1, 0)[1];
|
|
31
|
+
}
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
isServerSide,
|
|
35
|
+
useForceUpdate
|
|
36
|
+
});
|
|
2
37
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["import { useReducer } from 'react'\n\nexport const isServerSide =\n process.env.TAMAGUI_TARGET === 'web' && typeof window === 'undefined'\n\nconst idFn = () => {}\n\nexport function useForceUpdate() {\n return isServerSide ? idFn : (useReducer((x) => x + 1, 0)[1] as () => void)\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2B;AAEpB,MAAM,eACX,QAAQ,IAAI,mBAAmB,SAAS,OAAO,WAAW;AAE5D,MAAM,OAAO,MAAM;AAAC;AAEb,SAAS,iBAAiB;AAC/B,SAAO,eAAe,WAAQ,yBAAW,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,CAAC;AAC7D;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
import{useReducer
|
|
1
|
+
import { useReducer } from "react";
|
|
2
|
+
const isServerSide = process.env.TAMAGUI_TARGET === "web" && typeof window === "undefined";
|
|
3
|
+
const idFn = () => {
|
|
4
|
+
};
|
|
5
|
+
function useForceUpdate() {
|
|
6
|
+
return isServerSide ? idFn : useReducer((x) => x + 1, 0)[1];
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
isServerSide,
|
|
10
|
+
useForceUpdate
|
|
11
|
+
};
|
|
2
12
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["import { useReducer } from 'react'\n\nexport const isServerSide =\n process.env.TAMAGUI_TARGET === 'web' && typeof window === 'undefined'\n\nconst idFn = () => {}\n\nexport function useForceUpdate() {\n return isServerSide ? idFn : (useReducer((x) => x + 1, 0)[1] as () => void)\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAEpB,MAAM,eACX,QAAQ,IAAI,mBAAmB,SAAS,OAAO,WAAW;AAE5D,MAAM,OAAO,MAAM;AAAC;AAEb,SAAS,iBAAiB;AAC/B,SAAO,eAAe,OAAQ,WAAW,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,CAAC;AAC7D;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
import{useReducer
|
|
1
|
+
import { useReducer } from "react";
|
|
2
|
+
const isServerSide = process.env.TAMAGUI_TARGET === "web" && typeof window === "undefined";
|
|
3
|
+
const idFn = () => {
|
|
4
|
+
};
|
|
5
|
+
function useForceUpdate() {
|
|
6
|
+
return isServerSide ? idFn : useReducer((x) => x + 1, 0)[1];
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
isServerSide,
|
|
10
|
+
useForceUpdate
|
|
11
|
+
};
|
|
2
12
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["import { useReducer } from 'react'\n\nexport const isServerSide =\n process.env.TAMAGUI_TARGET === 'web' && typeof window === 'undefined'\n\nconst idFn = () => {}\n\nexport function useForceUpdate() {\n return isServerSide ? idFn : (useReducer((x) => x + 1, 0)[1] as () => void)\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAEpB,MAAM,eACX,QAAQ,IAAI,mBAAmB,SAAS,OAAO,WAAW;AAE5D,MAAM,OAAO,MAAM;AAAC;AAEb,SAAS,iBAAiB;AAC/B,SAAO,eAAe,OAAQ,WAAW,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,CAAC;AAC7D;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-force-update",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.2",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@tamagui/build": "1.14.
|
|
29
|
+
"@tamagui/build": "1.14.2",
|
|
30
30
|
"react": "^18.2.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|