@tamagui/use-force-update 1.0.0-beta.8 → 1.0.1-beta.100

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
@@ -2,7 +2,6 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
5
  var __export = (target, all) => {
7
6
  for (var name in all)
8
7
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -23,10 +22,8 @@ __export(src_exports, {
23
22
  module.exports = __toCommonJS(src_exports);
24
23
  var import_react = require("react");
25
24
  function useForceUpdate() {
26
- const [_, forceUpdate] = (0, import_react.useReducer)((x) => x + 1, 0);
27
- return forceUpdate;
25
+ return (0, import_react.useReducer)((x) => (x + 1) % Number.MAX_SAFE_INTEGER, 0)[1];
28
26
  }
29
- __name(useForceUpdate, "useForceUpdate");
30
27
  // Annotate the CommonJS export names for ESM import in node:
31
28
  0 && (module.exports = {
32
29
  useForceUpdate
@@ -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 const [_, forceUpdate] = useReducer((x) => x + 1, 0)\n return forceUpdate\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2B;AAEpB,0BAA0B;AAC/B,QAAM,CAAC,GAAG,eAAe,6BAAW,CAAC,MAAM,IAAI,GAAG,CAAC;AACnD,SAAO;AACT;AAHgB;",
4
+ "sourcesContent": ["import { useReducer } from 'react'\n\nexport function useForceUpdate() {\n return useReducer((x) => (x + 1) % Number.MAX_SAFE_INTEGER, 0)[1]\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2B;AAEpB,0BAA0B;AAC/B,SAAO,6BAAW,CAAC,MAAO,KAAI,KAAK,OAAO,kBAAkB,CAAC,EAAE;AACjE;",
6
6
  "names": []
7
7
  }
package/dist/esm/index.js CHANGED
@@ -1,11 +1,7 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
1
  import { useReducer } from "react";
4
2
  function useForceUpdate() {
5
- const [_, forceUpdate] = useReducer((x) => x + 1, 0);
6
- return forceUpdate;
3
+ return useReducer((x) => (x + 1) % Number.MAX_SAFE_INTEGER, 0)[1];
7
4
  }
8
- __name(useForceUpdate, "useForceUpdate");
9
5
  export {
10
6
  useForceUpdate
11
7
  };
@@ -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 const [_, forceUpdate] = useReducer((x) => x + 1, 0)\n return forceUpdate\n}\n"],
5
- "mappings": ";;AAAA;AAEO,0BAA0B;AAC/B,QAAM,CAAC,GAAG,eAAe,WAAW,CAAC,MAAM,IAAI,GAAG,CAAC;AACnD,SAAO;AACT;AAHgB;",
4
+ "sourcesContent": ["import { useReducer } from 'react'\n\nexport function useForceUpdate() {\n return useReducer((x) => (x + 1) % Number.MAX_SAFE_INTEGER, 0)[1]\n}\n"],
5
+ "mappings": "AAAA;AAEO,0BAA0B;AAC/B,SAAO,WAAW,CAAC,MAAO,KAAI,KAAK,OAAO,kBAAkB,CAAC,EAAE;AACjE;",
6
6
  "names": []
7
7
  }
package/dist/jsx/index.js CHANGED
@@ -1,11 +1,8 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
1
  import { useReducer } from "react";
4
2
  function useForceUpdate() {
5
- const [_, forceUpdate] = useReducer((x) => x + 1, 0);
6
- return forceUpdate;
3
+ return useReducer((x) => (x + 1) % Number.MAX_SAFE_INTEGER, 0)[1];
7
4
  }
8
- __name(useForceUpdate, "useForceUpdate");
9
5
  export {
10
6
  useForceUpdate
11
7
  };
8
+ //# 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 function useForceUpdate() {\n return useReducer((x) => (x + 1) % Number.MAX_SAFE_INTEGER, 0)[1]\n}\n"],
5
+ "mappings": "AAAA;AAEO,0BAA0B;AAC/B,SAAO,WAAW,CAAC,MAAO,KAAI,KAAK,OAAO,kBAAkB,CAAC,EAAE;AACjE;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@tamagui/use-force-update",
3
- "version": "1.0.0-beta.8",
4
- "typings": "types",
3
+ "version": "1.0.1-beta.100",
4
+ "types": "./types/index.d.ts",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
7
7
  "module:jsx": "dist/jsx",
8
8
  "files": [
9
+ "src",
9
10
  "types",
10
11
  "dist"
11
12
  ],
@@ -16,7 +17,7 @@
16
17
  "clean:build": "tamagui-build clean:build"
17
18
  },
18
19
  "devDependencies": {
19
- "@tamagui/build": "^1.0.0-beta.8",
20
+ "@tamagui/build": "^1.0.1-beta.100",
20
21
  "react": "*"
21
22
  },
22
23
  "peerDependencies": {
package/src/index.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { useReducer } from 'react'
2
+
3
+ export function useForceUpdate() {
4
+ return useReducer((x) => (x + 1) % Number.MAX_SAFE_INTEGER, 0)[1]
5
+ }
package/types/index.d.ts CHANGED
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,wBAAgB,cAAc,0CAG7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,wBAAgB,cAAc,0CAE7B"}