@tamagui/use-force-update 1.0.1-beta.21 → 1.0.1-beta.210
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 +7 -3
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/index.js +5 -4
- package/dist/esm/index.js.map +2 -2
- package/dist/jsx/index.js +6 -4
- package/dist/jsx/index.js.map +7 -0
- package/package.json +13 -4
- package/src/index.ts +9 -0
- package/types/index.d.ts +2 -2
- package/types/index.d.ts.map +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
6
|
var __export = (target, all) => {
|
|
7
7
|
for (var name in all)
|
|
8
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -18,16 +18,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var src_exports = {};
|
|
20
20
|
__export(src_exports, {
|
|
21
|
+
isServerSide: () => isServerSide,
|
|
21
22
|
useForceUpdate: () => useForceUpdate
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(src_exports);
|
|
24
25
|
var import_react = require("react");
|
|
26
|
+
const isServerSide = process.env.TAMAGUI_TARGET === "web" && typeof window === "undefined";
|
|
27
|
+
const idFn = () => {
|
|
28
|
+
};
|
|
25
29
|
function useForceUpdate() {
|
|
26
|
-
return (0, import_react.useReducer)((x) =>
|
|
30
|
+
return isServerSide ? idFn : (0, import_react.useReducer)((x) => x + 1, 0)[1];
|
|
27
31
|
}
|
|
28
|
-
__name(useForceUpdate, "useForceUpdate");
|
|
29
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
30
33
|
0 && (module.exports = {
|
|
34
|
+
isServerSide,
|
|
31
35
|
useForceUpdate
|
|
32
36
|
});
|
|
33
37
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { useReducer } from 'react'\n\nexport function useForceUpdate() {\n return useReducer((x) =>
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2B;AAEpB,
|
|
4
|
+
"sourcesContent": ["import { useReducer } from 'react'\n\nexport const isServerSide = 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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2B;AAEpB,MAAM,eAAe,QAAQ,IAAI,mBAAmB,SAAS,OAAO,WAAW;AAEtF,MAAM,OAAO,MAAM;AAAC;AAEb,SAAS,iBAAiB;AAC/B,SAAO,eAAe,WAAQ,yBAAW,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE;AAC5D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
1
|
import { useReducer } from "react";
|
|
2
|
+
const isServerSide = process.env.TAMAGUI_TARGET === "web" && typeof window === "undefined";
|
|
3
|
+
const idFn = () => {
|
|
4
|
+
};
|
|
4
5
|
function useForceUpdate() {
|
|
5
|
-
return useReducer((x) =>
|
|
6
|
+
return isServerSide ? idFn : useReducer((x) => x + 1, 0)[1];
|
|
6
7
|
}
|
|
7
|
-
__name(useForceUpdate, "useForceUpdate");
|
|
8
8
|
export {
|
|
9
|
+
isServerSide,
|
|
9
10
|
useForceUpdate
|
|
10
11
|
};
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { useReducer } from 'react'\n\nexport function useForceUpdate() {\n return useReducer((x) =>
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { useReducer } from 'react'\n\nexport const isServerSide = 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,SAAS,kBAAkB;AAEpB,MAAM,eAAe,QAAQ,IAAI,mBAAmB,SAAS,OAAO,WAAW;AAEtF,MAAM,OAAO,MAAM;AAAC;AAEb,SAAS,iBAAiB;AAC/B,SAAO,eAAe,OAAQ,WAAW,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE;AAC5D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
1
|
import { useReducer } from "react";
|
|
2
|
+
const isServerSide = process.env.TAMAGUI_TARGET === "web" && typeof window === "undefined";
|
|
3
|
+
const idFn = () => {
|
|
4
|
+
};
|
|
4
5
|
function useForceUpdate() {
|
|
5
|
-
return useReducer((x) =>
|
|
6
|
+
return isServerSide ? idFn : useReducer((x) => x + 1, 0)[1];
|
|
6
7
|
}
|
|
7
|
-
__name(useForceUpdate, "useForceUpdate");
|
|
8
8
|
export {
|
|
9
|
+
isServerSide,
|
|
9
10
|
useForceUpdate
|
|
10
11
|
};
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { useReducer } from 'react'\n\nexport const isServerSide = 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,SAAS,kBAAkB;AAEpB,MAAM,eAAe,QAAQ,IAAI,mBAAmB,SAAS,OAAO,WAAW;AAEtF,MAAM,OAAO,MAAM;AAAC;AAEb,SAAS,iBAAiB;AAC/B,SAAO,eAAe,OAAQ,WAAW,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE;AAC5D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-force-update",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
4
|
-
"
|
|
3
|
+
"version": "1.0.1-beta.210",
|
|
4
|
+
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
7
|
-
"module:jsx": "dist/jsx",
|
|
8
7
|
"files": [
|
|
8
|
+
"src",
|
|
9
9
|
"types",
|
|
10
10
|
"dist"
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "tamagui-build",
|
|
14
14
|
"watch": "tamagui-build --watch",
|
|
15
|
+
"lint": "eslint",
|
|
16
|
+
"lint:fix": "yarn lint --fix",
|
|
15
17
|
"clean": "tamagui-build clean",
|
|
16
18
|
"clean:build": "tamagui-build clean:build"
|
|
17
19
|
},
|
|
20
|
+
"exports": {
|
|
21
|
+
"./package.json": "./package.json",
|
|
22
|
+
".": {
|
|
23
|
+
"import": "./dist/esm/index.js",
|
|
24
|
+
"require": "./dist/cjs/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
18
27
|
"devDependencies": {
|
|
19
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
28
|
+
"@tamagui/build": "^1.0.1-beta.210",
|
|
20
29
|
"react": "*"
|
|
21
30
|
},
|
|
22
31
|
"peerDependencies": {
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useReducer } from 'react'
|
|
2
|
+
|
|
3
|
+
export const isServerSide = process.env.TAMAGUI_TARGET === 'web' && typeof window === 'undefined'
|
|
4
|
+
|
|
5
|
+
const idFn = () => {}
|
|
6
|
+
|
|
7
|
+
export function useForceUpdate() {
|
|
8
|
+
return isServerSide ? idFn : (useReducer((x) => x + 1, 0)[1] as () => void)
|
|
9
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function useForceUpdate():
|
|
1
|
+
export declare const isServerSide: boolean;
|
|
2
|
+
export declare function useForceUpdate(): () => void;
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,wBAAgB,cAAc,0CAG7B"}
|