@tamagui/use-force-update 1.0.0-beta.1 → 1.0.0-beta.12

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
@@ -23,8 +23,7 @@ __export(src_exports, {
23
23
  module.exports = __toCommonJS(src_exports);
24
24
  var import_react = require("react");
25
25
  function useForceUpdate() {
26
- const [_, forceUpdate] = (0, import_react.useReducer)((x) => x + 1, 0);
27
- return forceUpdate;
26
+ return (0, import_react.useReducer)((x) => (x + 1) % Number.MAX_SAFE_INTEGER, 0)[1];
28
27
  }
29
28
  __name(useForceUpdate, "useForceUpdate");
30
29
  // Annotate the CommonJS export names for ESM import in node:
@@ -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;AAFgB;",
6
6
  "names": []
7
7
  }
package/dist/esm/index.js CHANGED
@@ -2,8 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
  import { useReducer } from "react";
4
4
  function useForceUpdate() {
5
- const [_, forceUpdate] = useReducer((x) => x + 1, 0);
6
- return forceUpdate;
5
+ return useReducer((x) => (x + 1) % Number.MAX_SAFE_INTEGER, 0)[1];
7
6
  }
8
7
  __name(useForceUpdate, "useForceUpdate");
9
8
  export {
@@ -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;AAFgB;",
6
6
  "names": []
7
7
  }
package/dist/jsx/index.js CHANGED
@@ -2,8 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
  import { useReducer } from "react";
4
4
  function useForceUpdate() {
5
- const [_, forceUpdate] = useReducer((x) => x + 1, 0);
6
- return forceUpdate;
5
+ return useReducer((x) => (x + 1) % Number.MAX_SAFE_INTEGER, 0)[1];
7
6
  }
8
7
  __name(useForceUpdate, "useForceUpdate");
9
8
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/use-force-update",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.12",
4
4
  "typings": "types",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -16,7 +16,7 @@
16
16
  "clean:build": "tamagui-build clean:build"
17
17
  },
18
18
  "devDependencies": {
19
- "@tamagui/build": "^1.0.0-beta.1",
19
+ "@tamagui/build": "^1.0.0-beta.12",
20
20
  "react": "*"
21
21
  },
22
22
  "peerDependencies": {
@@ -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"}