@tamagui/use-force-update 1.0.0-alpha.39 → 1.0.0-alpha.42
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 +11 -10
- package/dist/cjs/index.js.map +1 -1
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
6
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
7
|
var __export = (target, all) => {
|
|
10
|
-
__markAsModule(target);
|
|
11
8
|
for (var name in all)
|
|
12
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
10
|
};
|
|
14
|
-
var __reExport = (target, module2, desc) => {
|
|
11
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
15
12
|
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
16
13
|
for (let key of __getOwnPropNames(module2))
|
|
17
|
-
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
14
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
18
15
|
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
19
16
|
}
|
|
20
17
|
return target;
|
|
21
18
|
};
|
|
22
|
-
var
|
|
23
|
-
return
|
|
24
|
-
};
|
|
25
|
-
|
|
19
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
+
return (module2, temp) => {
|
|
21
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
+
};
|
|
23
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
+
var src_exports = {};
|
|
25
|
+
__export(src_exports, {
|
|
26
26
|
useForceUpdate: () => useForceUpdate
|
|
27
27
|
});
|
|
28
|
-
var import_react =
|
|
28
|
+
var import_react = require("react");
|
|
29
29
|
function useForceUpdate() {
|
|
30
30
|
const setState = (0, import_react.useState)(0)[1];
|
|
31
31
|
const internal = (0, import_react.useRef)();
|
|
@@ -47,4 +47,5 @@ function useForceUpdate() {
|
|
|
47
47
|
return internal.current.update;
|
|
48
48
|
}
|
|
49
49
|
__name(useForceUpdate, "useForceUpdate");
|
|
50
|
+
module.exports = __toCommonJS(src_exports);
|
|
50
51
|
//# 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 { useEffect, useRef, useState } from 'react'\n\n// ensures no updates after unmount\n\nexport function useForceUpdate() {\n const setState = useState(0)[1]\n const internal = useRef<{ update: Function; isMounted: boolean }>()\n if (!internal.current) {\n internal.current = {\n isMounted: true,\n update: () => {\n if (internal.current!.isMounted) {\n setState(Math.random())\n }\n },\n }\n }\n\n useEffect(() => {\n return () => {\n internal.current!.isMounted = false\n }\n }, [])\n\n return internal.current.update\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA4C;AAIrC,0BAA0B;AAC/B,QAAM,WAAW,2BAAS,GAAG;AAC7B,QAAM,WAAW;AACjB,MAAI,CAAC,SAAS,SAAS;AACrB,aAAS,UAAU;AAAA,MACjB,WAAW;AAAA,MACX,QAAQ,MAAM;AACZ,YAAI,SAAS,QAAS,WAAW;AAC/B,mBAAS,KAAK;AAAA;AAAA;AAAA;AAAA;AAMtB,8BAAU,MAAM;AACd,WAAO,MAAM;AACX,eAAS,QAAS,YAAY;AAAA;AAAA,KAE/B;AAEH,SAAO,SAAS,QAAQ;AAAA;AApBV;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-force-update",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.42",
|
|
4
4
|
"typings": "types",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"watch": "tamagui-build --watch"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@tamagui/build": "^1.0.0-alpha.
|
|
17
|
+
"@tamagui/build": "^1.0.0-alpha.42"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"react": "*"
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "5f5d676601645cabf766c084cdf2b21e9eb5871a"
|
|
26
26
|
}
|