@fvc/hooks 1.1.0 → 1.1.1

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.
@@ -1 +1 @@
1
- export declare const useForceUpdate: () => import("react").ActionDispatch<[]>;
1
+ export declare const useForceUpdate: () => import("react").DispatchWithoutAction;
package/dist/lib/index.js CHANGED
@@ -1 +1 @@
1
- import{useRef as r,useReducer as t}from"react";function n(){return"fvc-".concat(Math.random().toString(36).substr(2,9))}var o=function(t,o){void 0===o&&(o=n);var e=r(o());return t||e.current};"function"==typeof SuppressedError&&SuppressedError;var e=function(){return function(r,t){var n="function"==typeof Symbol&&r[Symbol.iterator];if(!n)return r;var o,e,u=n.call(r),a=[];try{for(;(void 0===t||t-- >0)&&!(o=u.next()).done;)a.push(o.value)}catch(r){e={error:r}}finally{try{o&&!o.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}return a}(t((function(r){return r+1}),0),2)[1]};export{e as useForceUpdate,o as useId};
1
+ import{useRef as r,useReducer as t}from"react";function n(){return`fvc-${Math.random().toString(36).substr(2,9)}`}const o=(t,o=n)=>{const c=r(o());return t||c.current},c=()=>{const[,r]=t(r=>r+1,0);return r};export{c as useForceUpdate,o as useId};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fvc/hooks",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "main": "./dist/lib/index.js",
5
5
  "types": "./dist/lib/hooks/src/index.d.ts",
6
6
  "files": [
@@ -9,9 +9,15 @@
9
9
  "package.json"
10
10
  ],
11
11
  "scripts": {
12
- "build": "rm -rf dist && rm -rf .rollup.cache && eslint --config ../../eslint.config.js . && bunx tsc --noEmit && rollup -c ./rollup.config.mjs"
12
+ "build": "rollup -c ./rollup.config.mjs",
13
+ "clean": "rm -rf dist && rm -rf .rollup.cache && rm -rf .turbo",
14
+ "lint": "eslint --config ../../eslint.config.js \"src/**/*.{ts,tsx}\"",
15
+ "lint:fix": "eslint --config ../../eslint.config.js \"src/**/*.{ts,tsx}\" --fix",
16
+ "format": "prettier --write \"src/**/*.{ts,tsx}\"",
17
+ "type-check": "tsc --noEmit",
18
+ "test": "bun test --preload ../../tests/happydom.ts --preload ../../tests/testing-library.tsx"
13
19
  },
14
- "dependencies": {
20
+ "peerDependencies": {
15
21
  "react": "^18.0.0",
16
22
  "antd": "^5.0.0"
17
23
  }