@w3ux/hooks 0.0.2 → 1.0.0

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/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AAAA;wCACwC;AAExC,cAAc,0BAA0B,CAAC","file":"index.js","sourcesContent":["/* @license Copyright 2024 @polkadot-cloud/library authors & contributors\nSPDX-License-Identifier: GPL-3.0-only */\n\nexport * from \"./useEffectIgnoreInitial\";\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AAAA;wCACwC;AAExC,cAAc,0BAA0B,CAAC","file":"index.js","sourcesContent":["/* @license Copyright 2024 w3ux authors & contributors\nSPDX-License-Identifier: GPL-3.0-only */\n\nexport * from \"./useEffectIgnoreInitial\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "name": "@w3ux/hooks",
3
- "version": "0.0.2",
3
+ "version": "1.0.0",
4
4
  "license": "GPL-3.0-only",
5
- "type": "module"
5
+ "type": "module",
6
+ "peerDependencies": {
7
+ "react": "^18"
8
+ }
6
9
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/useEffectIgnoreInitial.tsx"],"names":[],"mappings":"AAAA;wCACwC;;;;;;;;;;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,CAAC,IAAM,sBAAsB,GAAG,UAAO,EAAK,EAAE,IAAS;IAC3D,IAAM,SAAS,GAAG,MAAM,CAAU,IAAI,CAAC,CAAC;IACxC,SAAS,CACP;QACE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;YACvB,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE,CAAC;gBAC7B,EAAE,EAAE,CAAC;YACP,CAAC;QACH,CAAC;QACD,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;IAC5B,CAAC,EACD,IAAI,CAAC,CAAC,mBAAK,IAAI,QAAE,CAAC,CAAC,SAAS,CAC7B,CAAC;AACJ,CAAC,CAAC","file":"useEffectIgnoreInitial.js","sourcesContent":["/* @license Copyright 2024 @polkadot-cloud/library authors & contributors\nSPDX-License-Identifier: GPL-3.0-only */\n\nimport { useEffect, useRef } from \"react\";\n\nexport const useEffectIgnoreInitial = <T, U>(fn: T, deps: U[]) => {\n const isInitial = useRef<boolean>(true);\n useEffect(\n () => {\n if (!isInitial.current) {\n if (typeof fn === \"function\") {\n fn();\n }\n }\n isInitial.current = false;\n },\n deps ? [...deps] : undefined\n );\n};\n"]}
1
+ {"version":3,"sources":["../src/useEffectIgnoreInitial.tsx"],"names":[],"mappings":"AAAA;wCACwC;;;;;;;;;;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,CAAC,IAAM,sBAAsB,GAAG,UAAO,EAAK,EAAE,IAAS;IAC3D,IAAM,SAAS,GAAG,MAAM,CAAU,IAAI,CAAC,CAAC;IACxC,SAAS,CACP;QACE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;YACvB,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE,CAAC;gBAC7B,EAAE,EAAE,CAAC;YACP,CAAC;QACH,CAAC;QACD,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;IAC5B,CAAC,EACD,IAAI,CAAC,CAAC,mBAAK,IAAI,QAAE,CAAC,CAAC,SAAS,CAC7B,CAAC;AACJ,CAAC,CAAC","file":"useEffectIgnoreInitial.js","sourcesContent":["/* @license Copyright 2024 w3ux authors & contributors\nSPDX-License-Identifier: GPL-3.0-only */\n\nimport { useEffect, useRef } from \"react\";\n\nexport const useEffectIgnoreInitial = <T, U>(fn: T, deps: U[]) => {\n const isInitial = useRef<boolean>(true);\n useEffect(\n () => {\n if (!isInitial.current) {\n if (typeof fn === \"function\") {\n fn();\n }\n }\n isInitial.current = false;\n },\n deps ? [...deps] : undefined\n );\n};\n"]}