@oneplatformdev/hooks 0.1.0-8 → 0.1.0-80

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.
Files changed (334) hide show
  1. package/CHANGELOG.md +280 -0
  2. package/package.json +14 -19
  3. package/{dist/useEventListener → useEventListener}/useEventListener.d.ts +4 -2
  4. package/{dist/useEventListener → useEventListener}/useEventListener.d.ts.map +1 -1
  5. package/{dist/useHover → useHover}/useHover.d.ts +1 -1
  6. package/{dist/useHover → useHover}/useHover.d.ts.map +1 -1
  7. package/{dist/useOnClickOutside → useOnClickOutside}/useOnClickOutside.d.ts +1 -1
  8. package/{dist/useOnClickOutside → useOnClickOutside}/useOnClickOutside.d.ts.map +1 -1
  9. package/{dist/useResizeObserver → useResizeObserver}/useResizeObserver.d.ts +1 -1
  10. package/{dist/useResizeObserver → useResizeObserver}/useResizeObserver.d.ts.map +1 -1
  11. package/.babelrc +0 -12
  12. package/dist/CHANGELOG.md +0 -15
  13. package/dist/LICENSE +0 -21
  14. package/dist/README.md +0 -7
  15. package/dist/package.json +0 -68
  16. package/node_modules/@types/lodash.debounce/LICENSE +0 -21
  17. package/node_modules/@types/lodash.debounce/README.md +0 -23
  18. package/node_modules/@types/lodash.debounce/index.d.ts +0 -4
  19. package/node_modules/@types/lodash.debounce/package.json +0 -32
  20. package/node_modules/@types/react/LICENSE +0 -21
  21. package/node_modules/@types/react/README.md +0 -15
  22. package/node_modules/@types/react/canary.d.ts +0 -35
  23. package/node_modules/@types/react/compiler-runtime.d.ts +0 -4
  24. package/node_modules/@types/react/experimental.d.ts +0 -125
  25. package/node_modules/@types/react/global.d.ts +0 -160
  26. package/node_modules/@types/react/index.d.ts +0 -4206
  27. package/node_modules/@types/react/jsx-dev-runtime.d.ts +0 -45
  28. package/node_modules/@types/react/jsx-runtime.d.ts +0 -36
  29. package/node_modules/@types/react/package.json +0 -210
  30. package/node_modules/@types/react/ts5.0/canary.d.ts +0 -35
  31. package/node_modules/@types/react/ts5.0/experimental.d.ts +0 -125
  32. package/node_modules/@types/react/ts5.0/global.d.ts +0 -160
  33. package/node_modules/@types/react/ts5.0/index.d.ts +0 -4193
  34. package/node_modules/@types/react/ts5.0/jsx-dev-runtime.d.ts +0 -44
  35. package/node_modules/@types/react/ts5.0/jsx-runtime.d.ts +0 -35
  36. package/node_modules/@types/react/ts5.0/v18/global.d.ts +0 -160
  37. package/node_modules/@types/react/ts5.0/v18/index.d.ts +0 -4543
  38. package/node_modules/@types/react/ts5.0/v18/jsx-dev-runtime.d.ts +0 -45
  39. package/node_modules/@types/react/ts5.0/v18/jsx-runtime.d.ts +0 -36
  40. package/node_modules/@types/react/ts5.0/v18/ts5.0/global.d.ts +0 -160
  41. package/node_modules/@types/react/ts5.0/v18/ts5.0/index.d.ts +0 -4530
  42. package/node_modules/@types/react/ts5.0/v18/ts5.0/jsx-dev-runtime.d.ts +0 -44
  43. package/node_modules/@types/react/ts5.0/v18/ts5.0/jsx-runtime.d.ts +0 -35
  44. package/src/index.ts +0 -36
  45. package/src/useBoolean/index.ts +0 -1
  46. package/src/useBoolean/useBoolean.ts +0 -50
  47. package/src/useClickAnyWhere/index.ts +0 -1
  48. package/src/useClickAnyWhere/useClickAnyWhere.ts +0 -22
  49. package/src/useCopyToClipboard/index.ts +0 -1
  50. package/src/useCopyToClipboard/useCopyToClipboard.ts +0 -58
  51. package/src/useCountdown/index.ts +0 -1
  52. package/src/useCountdown/useCountdown.ts +0 -102
  53. package/src/useCounter/index.ts +0 -1
  54. package/src/useCounter/useCounter.ts +0 -52
  55. package/src/useDarkMode/index.ts +0 -1
  56. package/src/useDarkMode/useDarkMode.ts +0 -92
  57. package/src/useDebounceCallback/index.ts +0 -2
  58. package/src/useDebounceCallback/useDebounceCallback.ts +0 -115
  59. package/src/useDebounceValue/index.ts +0 -1
  60. package/src/useDebounceValue/useDebounceValue.ts +0 -67
  61. package/src/useDocumentTitle/index.ts +0 -1
  62. package/src/useDocumentTitle/useDocumentTitle.ts +0 -43
  63. package/src/useEventCallback/index.ts +0 -1
  64. package/src/useEventCallback/useEventCallback.ts +0 -40
  65. package/src/useEventListener/index.ts +0 -1
  66. package/src/useEventListener/useEventListener.ts +0 -121
  67. package/src/useHover/index.ts +0 -1
  68. package/src/useHover/useHover.ts +0 -37
  69. package/src/useIntersectionObserver/index.ts +0 -1
  70. package/src/useIntersectionObserver/useIntersectionObserver.ts +0 -186
  71. package/src/useInterval/index.ts +0 -1
  72. package/src/useInterval/useInterval.ts +0 -43
  73. package/src/useIsClient/index.ts +0 -1
  74. package/src/useIsClient/useIsClient.ts +0 -22
  75. package/src/useIsMobile/index.ts +0 -2
  76. package/src/useIsMobile/types.ts +0 -3
  77. package/src/useIsMobile/useIsMobile.tsx +0 -23
  78. package/src/useIsMounted/index.ts +0 -1
  79. package/src/useIsMounted/useIsMounted.ts +0 -15
  80. package/src/useIsomorphicLayoutEffect/index.ts +0 -1
  81. package/src/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.ts +0 -17
  82. package/src/useLocalStorage/index.ts +0 -1
  83. package/src/useLocalStorage/useLocalStorage.ts +0 -191
  84. package/src/useLockBody/index.ts +0 -1
  85. package/src/useLockBody/useLockBody.tsx +0 -12
  86. package/src/useMap/index.ts +0 -1
  87. package/src/useMap/useMap.ts +0 -83
  88. package/src/useMediaQuery/index.ts +0 -1
  89. package/src/useMediaQuery/useMediaQuery.ts +0 -83
  90. package/src/useOnClickOutside/index.ts +0 -1
  91. package/src/useOnClickOutside/useOnClickOutside.ts +0 -61
  92. package/src/useQueryString/index.ts +0 -1
  93. package/src/useQueryString/useQueryString.ts +0 -26
  94. package/src/useReadLocalStorage/index.ts +0 -1
  95. package/src/useReadLocalStorage/useReadLocalStorage.ts +0 -122
  96. package/src/useResizeObserver/index.ts +0 -1
  97. package/src/useResizeObserver/useResizeObserver.ts +0 -131
  98. package/src/useScreen/index.ts +0 -1
  99. package/src/useScreen/useScreen.ts +0 -106
  100. package/src/useScript/index.ts +0 -1
  101. package/src/useScript/useScript.ts +0 -142
  102. package/src/useScrollLock/index.ts +0 -1
  103. package/src/useScrollLock/useScrollLock.ts +0 -141
  104. package/src/useSessionStorage/index.ts +0 -1
  105. package/src/useSessionStorage/useSessionStorage.ts +0 -191
  106. package/src/useStep/index.ts +0 -1
  107. package/src/useStep/useStep.ts +0 -83
  108. package/src/useTernaryDarkMode/index.ts +0 -1
  109. package/src/useTernaryDarkMode/useTernaryDarkMode.ts +0 -81
  110. package/src/useTimeout/index.ts +0 -1
  111. package/src/useTimeout/useTimeout.ts +0 -44
  112. package/src/useToggle/index.ts +0 -1
  113. package/src/useToggle/useToggle.ts +0 -30
  114. package/src/useUnmount/index.ts +0 -1
  115. package/src/useUnmount/useUnmount.ts +0 -26
  116. package/src/useWindowSize/index.ts +0 -1
  117. package/src/useWindowSize/useWindowSize.ts +0 -100
  118. package/tsconfig.json +0 -10
  119. package/tsconfig.lib.json +0 -33
  120. package/vite.config.ts +0 -62
  121. /package/{dist/index.d.ts → index.d.ts} +0 -0
  122. /package/{dist/index.d.ts.map → index.d.ts.map} +0 -0
  123. /package/{dist/index.js → index.js} +0 -0
  124. /package/{dist/useBoolean → useBoolean}/index.d.ts +0 -0
  125. /package/{dist/useBoolean → useBoolean}/index.d.ts.map +0 -0
  126. /package/{dist/useBoolean → useBoolean}/index.js +0 -0
  127. /package/{dist/useBoolean → useBoolean}/useBoolean.d.ts +0 -0
  128. /package/{dist/useBoolean → useBoolean}/useBoolean.d.ts.map +0 -0
  129. /package/{dist/useBoolean → useBoolean}/useBoolean.js +0 -0
  130. /package/{dist/useClickAnyWhere → useClickAnyWhere}/index.d.ts +0 -0
  131. /package/{dist/useClickAnyWhere → useClickAnyWhere}/index.d.ts.map +0 -0
  132. /package/{dist/useClickAnyWhere → useClickAnyWhere}/index.js +0 -0
  133. /package/{dist/useClickAnyWhere → useClickAnyWhere}/useClickAnyWhere.d.ts +0 -0
  134. /package/{dist/useClickAnyWhere → useClickAnyWhere}/useClickAnyWhere.d.ts.map +0 -0
  135. /package/{dist/useClickAnyWhere → useClickAnyWhere}/useClickAnyWhere.js +0 -0
  136. /package/{dist/useCopyToClipboard → useCopyToClipboard}/index.d.ts +0 -0
  137. /package/{dist/useCopyToClipboard → useCopyToClipboard}/index.d.ts.map +0 -0
  138. /package/{dist/useCopyToClipboard → useCopyToClipboard}/index.js +0 -0
  139. /package/{dist/useCopyToClipboard → useCopyToClipboard}/useCopyToClipboard.d.ts +0 -0
  140. /package/{dist/useCopyToClipboard → useCopyToClipboard}/useCopyToClipboard.d.ts.map +0 -0
  141. /package/{dist/useCopyToClipboard → useCopyToClipboard}/useCopyToClipboard.js +0 -0
  142. /package/{dist/useCountdown → useCountdown}/index.d.ts +0 -0
  143. /package/{dist/useCountdown → useCountdown}/index.d.ts.map +0 -0
  144. /package/{dist/useCountdown → useCountdown}/index.js +0 -0
  145. /package/{dist/useCountdown → useCountdown}/useCountdown.d.ts +0 -0
  146. /package/{dist/useCountdown → useCountdown}/useCountdown.d.ts.map +0 -0
  147. /package/{dist/useCountdown → useCountdown}/useCountdown.js +0 -0
  148. /package/{dist/useCounter → useCounter}/index.d.ts +0 -0
  149. /package/{dist/useCounter → useCounter}/index.d.ts.map +0 -0
  150. /package/{dist/useCounter → useCounter}/index.js +0 -0
  151. /package/{dist/useCounter → useCounter}/useCounter.d.ts +0 -0
  152. /package/{dist/useCounter → useCounter}/useCounter.d.ts.map +0 -0
  153. /package/{dist/useCounter → useCounter}/useCounter.js +0 -0
  154. /package/{dist/useDarkMode → useDarkMode}/index.d.ts +0 -0
  155. /package/{dist/useDarkMode → useDarkMode}/index.d.ts.map +0 -0
  156. /package/{dist/useDarkMode → useDarkMode}/index.js +0 -0
  157. /package/{dist/useDarkMode → useDarkMode}/useDarkMode.d.ts +0 -0
  158. /package/{dist/useDarkMode → useDarkMode}/useDarkMode.d.ts.map +0 -0
  159. /package/{dist/useDarkMode → useDarkMode}/useDarkMode.js +0 -0
  160. /package/{dist/useDebounceCallback → useDebounceCallback}/index.d.ts +0 -0
  161. /package/{dist/useDebounceCallback → useDebounceCallback}/index.d.ts.map +0 -0
  162. /package/{dist/useDebounceCallback → useDebounceCallback}/index.js +0 -0
  163. /package/{dist/useDebounceCallback → useDebounceCallback}/useDebounceCallback.d.ts +0 -0
  164. /package/{dist/useDebounceCallback → useDebounceCallback}/useDebounceCallback.d.ts.map +0 -0
  165. /package/{dist/useDebounceCallback → useDebounceCallback}/useDebounceCallback.js +0 -0
  166. /package/{dist/useDebounceValue → useDebounceValue}/index.d.ts +0 -0
  167. /package/{dist/useDebounceValue → useDebounceValue}/index.d.ts.map +0 -0
  168. /package/{dist/useDebounceValue → useDebounceValue}/index.js +0 -0
  169. /package/{dist/useDebounceValue → useDebounceValue}/useDebounceValue.d.ts +0 -0
  170. /package/{dist/useDebounceValue → useDebounceValue}/useDebounceValue.d.ts.map +0 -0
  171. /package/{dist/useDebounceValue → useDebounceValue}/useDebounceValue.js +0 -0
  172. /package/{dist/useDocumentTitle → useDocumentTitle}/index.d.ts +0 -0
  173. /package/{dist/useDocumentTitle → useDocumentTitle}/index.d.ts.map +0 -0
  174. /package/{dist/useDocumentTitle → useDocumentTitle}/index.js +0 -0
  175. /package/{dist/useDocumentTitle → useDocumentTitle}/useDocumentTitle.d.ts +0 -0
  176. /package/{dist/useDocumentTitle → useDocumentTitle}/useDocumentTitle.d.ts.map +0 -0
  177. /package/{dist/useDocumentTitle → useDocumentTitle}/useDocumentTitle.js +0 -0
  178. /package/{dist/useEventCallback → useEventCallback}/index.d.ts +0 -0
  179. /package/{dist/useEventCallback → useEventCallback}/index.d.ts.map +0 -0
  180. /package/{dist/useEventCallback → useEventCallback}/index.js +0 -0
  181. /package/{dist/useEventCallback → useEventCallback}/useEventCallback.d.ts +0 -0
  182. /package/{dist/useEventCallback → useEventCallback}/useEventCallback.d.ts.map +0 -0
  183. /package/{dist/useEventCallback → useEventCallback}/useEventCallback.js +0 -0
  184. /package/{dist/useEventListener → useEventListener}/index.d.ts +0 -0
  185. /package/{dist/useEventListener → useEventListener}/index.d.ts.map +0 -0
  186. /package/{dist/useEventListener → useEventListener}/index.js +0 -0
  187. /package/{dist/useEventListener → useEventListener}/useEventListener.js +0 -0
  188. /package/{dist/useHover → useHover}/index.d.ts +0 -0
  189. /package/{dist/useHover → useHover}/index.d.ts.map +0 -0
  190. /package/{dist/useHover → useHover}/index.js +0 -0
  191. /package/{dist/useHover → useHover}/useHover.js +0 -0
  192. /package/{dist/useIntersectionObserver → useIntersectionObserver}/index.d.ts +0 -0
  193. /package/{dist/useIntersectionObserver → useIntersectionObserver}/index.d.ts.map +0 -0
  194. /package/{dist/useIntersectionObserver → useIntersectionObserver}/index.js +0 -0
  195. /package/{dist/useIntersectionObserver → useIntersectionObserver}/useIntersectionObserver.d.ts +0 -0
  196. /package/{dist/useIntersectionObserver → useIntersectionObserver}/useIntersectionObserver.d.ts.map +0 -0
  197. /package/{dist/useIntersectionObserver → useIntersectionObserver}/useIntersectionObserver.js +0 -0
  198. /package/{dist/useInterval → useInterval}/index.d.ts +0 -0
  199. /package/{dist/useInterval → useInterval}/index.d.ts.map +0 -0
  200. /package/{dist/useInterval → useInterval}/index.js +0 -0
  201. /package/{dist/useInterval → useInterval}/useInterval.d.ts +0 -0
  202. /package/{dist/useInterval → useInterval}/useInterval.d.ts.map +0 -0
  203. /package/{dist/useInterval → useInterval}/useInterval.js +0 -0
  204. /package/{dist/useIsClient → useIsClient}/index.d.ts +0 -0
  205. /package/{dist/useIsClient → useIsClient}/index.d.ts.map +0 -0
  206. /package/{dist/useIsClient → useIsClient}/index.js +0 -0
  207. /package/{dist/useIsClient → useIsClient}/useIsClient.d.ts +0 -0
  208. /package/{dist/useIsClient → useIsClient}/useIsClient.d.ts.map +0 -0
  209. /package/{dist/useIsClient → useIsClient}/useIsClient.js +0 -0
  210. /package/{dist/useIsMobile → useIsMobile}/index.d.ts +0 -0
  211. /package/{dist/useIsMobile → useIsMobile}/index.d.ts.map +0 -0
  212. /package/{dist/useIsMobile → useIsMobile}/index.js +0 -0
  213. /package/{dist/useIsMobile → useIsMobile}/types.d.ts +0 -0
  214. /package/{dist/useIsMobile → useIsMobile}/types.d.ts.map +0 -0
  215. /package/{dist/useIsMobile → useIsMobile}/types.js +0 -0
  216. /package/{dist/useIsMobile → useIsMobile}/useIsMobile.d.ts +0 -0
  217. /package/{dist/useIsMobile → useIsMobile}/useIsMobile.d.ts.map +0 -0
  218. /package/{dist/useIsMobile → useIsMobile}/useIsMobile.js +0 -0
  219. /package/{dist/useIsMounted → useIsMounted}/index.d.ts +0 -0
  220. /package/{dist/useIsMounted → useIsMounted}/index.d.ts.map +0 -0
  221. /package/{dist/useIsMounted → useIsMounted}/index.js +0 -0
  222. /package/{dist/useIsMounted → useIsMounted}/useIsMounted.d.ts +0 -0
  223. /package/{dist/useIsMounted → useIsMounted}/useIsMounted.d.ts.map +0 -0
  224. /package/{dist/useIsMounted → useIsMounted}/useIsMounted.js +0 -0
  225. /package/{dist/useIsomorphicLayoutEffect → useIsomorphicLayoutEffect}/index.d.ts +0 -0
  226. /package/{dist/useIsomorphicLayoutEffect → useIsomorphicLayoutEffect}/index.d.ts.map +0 -0
  227. /package/{dist/useIsomorphicLayoutEffect → useIsomorphicLayoutEffect}/index.js +0 -0
  228. /package/{dist/useIsomorphicLayoutEffect → useIsomorphicLayoutEffect}/useIsomorphicLayoutEffect.d.ts +0 -0
  229. /package/{dist/useIsomorphicLayoutEffect → useIsomorphicLayoutEffect}/useIsomorphicLayoutEffect.d.ts.map +0 -0
  230. /package/{dist/useIsomorphicLayoutEffect → useIsomorphicLayoutEffect}/useIsomorphicLayoutEffect.js +0 -0
  231. /package/{dist/useLocalStorage → useLocalStorage}/index.d.ts +0 -0
  232. /package/{dist/useLocalStorage → useLocalStorage}/index.d.ts.map +0 -0
  233. /package/{dist/useLocalStorage → useLocalStorage}/index.js +0 -0
  234. /package/{dist/useLocalStorage → useLocalStorage}/useLocalStorage.d.ts +0 -0
  235. /package/{dist/useLocalStorage → useLocalStorage}/useLocalStorage.d.ts.map +0 -0
  236. /package/{dist/useLocalStorage → useLocalStorage}/useLocalStorage.js +0 -0
  237. /package/{dist/useLockBody → useLockBody}/index.d.ts +0 -0
  238. /package/{dist/useLockBody → useLockBody}/index.d.ts.map +0 -0
  239. /package/{dist/useLockBody → useLockBody}/index.js +0 -0
  240. /package/{dist/useLockBody → useLockBody}/useLockBody.d.ts +0 -0
  241. /package/{dist/useLockBody → useLockBody}/useLockBody.d.ts.map +0 -0
  242. /package/{dist/useLockBody → useLockBody}/useLockBody.js +0 -0
  243. /package/{dist/useMap → useMap}/index.d.ts +0 -0
  244. /package/{dist/useMap → useMap}/index.d.ts.map +0 -0
  245. /package/{dist/useMap → useMap}/index.js +0 -0
  246. /package/{dist/useMap → useMap}/useMap.d.ts +0 -0
  247. /package/{dist/useMap → useMap}/useMap.d.ts.map +0 -0
  248. /package/{dist/useMap → useMap}/useMap.js +0 -0
  249. /package/{dist/useMediaQuery → useMediaQuery}/index.d.ts +0 -0
  250. /package/{dist/useMediaQuery → useMediaQuery}/index.d.ts.map +0 -0
  251. /package/{dist/useMediaQuery → useMediaQuery}/index.js +0 -0
  252. /package/{dist/useMediaQuery → useMediaQuery}/useMediaQuery.d.ts +0 -0
  253. /package/{dist/useMediaQuery → useMediaQuery}/useMediaQuery.d.ts.map +0 -0
  254. /package/{dist/useMediaQuery → useMediaQuery}/useMediaQuery.js +0 -0
  255. /package/{dist/useOnClickOutside → useOnClickOutside}/index.d.ts +0 -0
  256. /package/{dist/useOnClickOutside → useOnClickOutside}/index.d.ts.map +0 -0
  257. /package/{dist/useOnClickOutside → useOnClickOutside}/index.js +0 -0
  258. /package/{dist/useOnClickOutside → useOnClickOutside}/useOnClickOutside.js +0 -0
  259. /package/{dist/useQueryString → useQueryString}/index.d.ts +0 -0
  260. /package/{dist/useQueryString → useQueryString}/index.d.ts.map +0 -0
  261. /package/{dist/useQueryString → useQueryString}/index.js +0 -0
  262. /package/{dist/useQueryString → useQueryString}/useQueryString.d.ts +0 -0
  263. /package/{dist/useQueryString → useQueryString}/useQueryString.d.ts.map +0 -0
  264. /package/{dist/useQueryString → useQueryString}/useQueryString.js +0 -0
  265. /package/{dist/useReadLocalStorage → useReadLocalStorage}/index.d.ts +0 -0
  266. /package/{dist/useReadLocalStorage → useReadLocalStorage}/index.d.ts.map +0 -0
  267. /package/{dist/useReadLocalStorage → useReadLocalStorage}/index.js +0 -0
  268. /package/{dist/useReadLocalStorage → useReadLocalStorage}/useReadLocalStorage.d.ts +0 -0
  269. /package/{dist/useReadLocalStorage → useReadLocalStorage}/useReadLocalStorage.d.ts.map +0 -0
  270. /package/{dist/useReadLocalStorage → useReadLocalStorage}/useReadLocalStorage.js +0 -0
  271. /package/{dist/useResizeObserver → useResizeObserver}/index.d.ts +0 -0
  272. /package/{dist/useResizeObserver → useResizeObserver}/index.d.ts.map +0 -0
  273. /package/{dist/useResizeObserver → useResizeObserver}/index.js +0 -0
  274. /package/{dist/useResizeObserver → useResizeObserver}/useResizeObserver.js +0 -0
  275. /package/{dist/useScreen → useScreen}/index.d.ts +0 -0
  276. /package/{dist/useScreen → useScreen}/index.d.ts.map +0 -0
  277. /package/{dist/useScreen → useScreen}/index.js +0 -0
  278. /package/{dist/useScreen → useScreen}/useScreen.d.ts +0 -0
  279. /package/{dist/useScreen → useScreen}/useScreen.d.ts.map +0 -0
  280. /package/{dist/useScreen → useScreen}/useScreen.js +0 -0
  281. /package/{dist/useScript → useScript}/index.d.ts +0 -0
  282. /package/{dist/useScript → useScript}/index.d.ts.map +0 -0
  283. /package/{dist/useScript → useScript}/index.js +0 -0
  284. /package/{dist/useScript → useScript}/useScript.d.ts +0 -0
  285. /package/{dist/useScript → useScript}/useScript.d.ts.map +0 -0
  286. /package/{dist/useScript → useScript}/useScript.js +0 -0
  287. /package/{dist/useScrollLock → useScrollLock}/index.d.ts +0 -0
  288. /package/{dist/useScrollLock → useScrollLock}/index.d.ts.map +0 -0
  289. /package/{dist/useScrollLock → useScrollLock}/index.js +0 -0
  290. /package/{dist/useScrollLock → useScrollLock}/useScrollLock.d.ts +0 -0
  291. /package/{dist/useScrollLock → useScrollLock}/useScrollLock.d.ts.map +0 -0
  292. /package/{dist/useScrollLock → useScrollLock}/useScrollLock.js +0 -0
  293. /package/{dist/useSessionStorage → useSessionStorage}/index.d.ts +0 -0
  294. /package/{dist/useSessionStorage → useSessionStorage}/index.d.ts.map +0 -0
  295. /package/{dist/useSessionStorage → useSessionStorage}/index.js +0 -0
  296. /package/{dist/useSessionStorage → useSessionStorage}/useSessionStorage.d.ts +0 -0
  297. /package/{dist/useSessionStorage → useSessionStorage}/useSessionStorage.d.ts.map +0 -0
  298. /package/{dist/useSessionStorage → useSessionStorage}/useSessionStorage.js +0 -0
  299. /package/{dist/useStep → useStep}/index.d.ts +0 -0
  300. /package/{dist/useStep → useStep}/index.d.ts.map +0 -0
  301. /package/{dist/useStep → useStep}/index.js +0 -0
  302. /package/{dist/useStep → useStep}/useStep.d.ts +0 -0
  303. /package/{dist/useStep → useStep}/useStep.d.ts.map +0 -0
  304. /package/{dist/useStep → useStep}/useStep.js +0 -0
  305. /package/{dist/useTernaryDarkMode → useTernaryDarkMode}/index.d.ts +0 -0
  306. /package/{dist/useTernaryDarkMode → useTernaryDarkMode}/index.d.ts.map +0 -0
  307. /package/{dist/useTernaryDarkMode → useTernaryDarkMode}/index.js +0 -0
  308. /package/{dist/useTernaryDarkMode → useTernaryDarkMode}/useTernaryDarkMode.d.ts +0 -0
  309. /package/{dist/useTernaryDarkMode → useTernaryDarkMode}/useTernaryDarkMode.d.ts.map +0 -0
  310. /package/{dist/useTernaryDarkMode → useTernaryDarkMode}/useTernaryDarkMode.js +0 -0
  311. /package/{dist/useTimeout → useTimeout}/index.d.ts +0 -0
  312. /package/{dist/useTimeout → useTimeout}/index.d.ts.map +0 -0
  313. /package/{dist/useTimeout → useTimeout}/index.js +0 -0
  314. /package/{dist/useTimeout → useTimeout}/useTimeout.d.ts +0 -0
  315. /package/{dist/useTimeout → useTimeout}/useTimeout.d.ts.map +0 -0
  316. /package/{dist/useTimeout → useTimeout}/useTimeout.js +0 -0
  317. /package/{dist/useToggle → useToggle}/index.d.ts +0 -0
  318. /package/{dist/useToggle → useToggle}/index.d.ts.map +0 -0
  319. /package/{dist/useToggle → useToggle}/index.js +0 -0
  320. /package/{dist/useToggle → useToggle}/useToggle.d.ts +0 -0
  321. /package/{dist/useToggle → useToggle}/useToggle.d.ts.map +0 -0
  322. /package/{dist/useToggle → useToggle}/useToggle.js +0 -0
  323. /package/{dist/useUnmount → useUnmount}/index.d.ts +0 -0
  324. /package/{dist/useUnmount → useUnmount}/index.d.ts.map +0 -0
  325. /package/{dist/useUnmount → useUnmount}/index.js +0 -0
  326. /package/{dist/useUnmount → useUnmount}/useUnmount.d.ts +0 -0
  327. /package/{dist/useUnmount → useUnmount}/useUnmount.d.ts.map +0 -0
  328. /package/{dist/useUnmount → useUnmount}/useUnmount.js +0 -0
  329. /package/{dist/useWindowSize → useWindowSize}/index.d.ts +0 -0
  330. /package/{dist/useWindowSize → useWindowSize}/index.d.ts.map +0 -0
  331. /package/{dist/useWindowSize → useWindowSize}/index.js +0 -0
  332. /package/{dist/useWindowSize → useWindowSize}/useWindowSize.d.ts +0 -0
  333. /package/{dist/useWindowSize → useWindowSize}/useWindowSize.d.ts.map +0 -0
  334. /package/{dist/useWindowSize → useWindowSize}/useWindowSize.js +0 -0
@@ -1,191 +0,0 @@
1
- import { useCallback, useEffect, useState } from 'react'
2
-
3
- import type { Dispatch, SetStateAction } from 'react'
4
-
5
- import { useEventCallback } from '../useEventCallback'
6
- import { useEventListener } from '../useEventListener'
7
-
8
- declare global {
9
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
10
- interface WindowEventMap {
11
- 'local-storage': CustomEvent
12
- }
13
- }
14
-
15
- /**
16
- * Options for customizing the behavior of serialization and deserialization.
17
- * @template T - The type of the state to be stored in local storage.
18
- */
19
- type UseLocalStorageOptions<T> = {
20
- /** A function to serialize the value before storing it. */
21
- serializer?: (value: T) => string
22
- /** A function to deserialize the stored value. */
23
- deserializer?: (value: string) => T
24
- /**
25
- * If `true` (default), the hook will initialize reading the local storage. In SSR, you should set it to `false`, returning the initial value initially.
26
- * @default true
27
- */
28
- initializeWithValue?: boolean
29
- }
30
-
31
- const IS_SERVER = typeof window === 'undefined'
32
-
33
- /**
34
- * Custom hook that uses the [`localStorage API`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) to persist state across page reloads.
35
- * @template T - The type of the state to be stored in local storage.
36
- * @param {string} key - The key under which the value will be stored in local storage.
37
- * @param {T | (() => T)} initialValue - The initial value of the state or a function that returns the initial value.
38
- * @param {UseLocalStorageOptions<T>} [options] - Options for customizing the behavior of serialization and deserialization (optional).
39
- * @returns {[T, Dispatch<SetStateAction<T>>, () => void]} A tuple containing the stored value, a function to set the value and a function to remove the key from storage.
40
- * @public
41
- * @see [Documentation](https://usehooks-ts.com/react-hook/use-local-storage)
42
- * @example
43
- * ```tsx
44
- * const [count, setCount, removeCount] = useLocalStorage('count', 0);
45
- * // Access the `count` value, the `setCount` function to update it and `removeCount` function to remove the key from storage.
46
- * ```
47
- */
48
- export function useLocalStorage<T>(
49
- key: string,
50
- initialValue: T | (() => T),
51
- options: UseLocalStorageOptions<T> = {},
52
- ): [T, Dispatch<SetStateAction<T>>, () => void] {
53
- const { initializeWithValue = true } = options
54
-
55
- const serializer = useCallback<(value: T) => string>(
56
- value => {
57
- if (options.serializer) {
58
- return options.serializer(value)
59
- }
60
-
61
- return JSON.stringify(value)
62
- },
63
- [options],
64
- )
65
-
66
- const deserializer = useCallback<(value: string) => T>(
67
- value => {
68
- if (options.deserializer) {
69
- return options.deserializer(value)
70
- }
71
- // Support 'undefined' as a value
72
- if (value === 'undefined') {
73
- return undefined as unknown as T
74
- }
75
-
76
- const defaultValue =
77
- initialValue instanceof Function ? initialValue() : initialValue
78
-
79
- let parsed: unknown
80
- try {
81
- parsed = JSON.parse(value)
82
- } catch (error) {
83
- console.error('Error parsing JSON:', error)
84
- return defaultValue // Return initialValue if parsing fails
85
- }
86
-
87
- return parsed as T
88
- },
89
- [options, initialValue],
90
- )
91
-
92
- // Get from local storage then
93
- // parse stored json or return initialValue
94
- const readValue = useCallback((): T => {
95
- const initialValueToUse =
96
- initialValue instanceof Function ? initialValue() : initialValue
97
-
98
- // Prevent build error "window is undefined" but keep working
99
- if (IS_SERVER) {
100
- return initialValueToUse
101
- }
102
-
103
- try {
104
- const raw = window.localStorage.getItem(key)
105
- return raw ? deserializer(raw) : initialValueToUse
106
- } catch (error) {
107
- console.warn(`Error reading localStorage key “${key}”:`, error)
108
- return initialValueToUse
109
- }
110
- }, [initialValue, key, deserializer])
111
-
112
- const [storedValue, setStoredValue] = useState(() => {
113
- if (initializeWithValue) {
114
- return readValue()
115
- }
116
-
117
- return initialValue instanceof Function ? initialValue() : initialValue
118
- })
119
-
120
- // Return a wrapped version of useState's setter function that ...
121
- // ... persists the new value to localStorage.
122
- const setValue: Dispatch<SetStateAction<T>> = useEventCallback(value => {
123
- // Prevent build error "window is undefined" but keeps working
124
- if (IS_SERVER) {
125
- console.warn(
126
- `Tried setting localStorage key “${key}” even though environment is not a client`,
127
- )
128
- }
129
-
130
- try {
131
- // Allow value to be a function so we have the same API as useState
132
- const newValue = value instanceof Function ? value(readValue()) : value
133
-
134
- // Save to local storage
135
- window.localStorage.setItem(key, serializer(newValue))
136
-
137
- // Save state
138
- setStoredValue(newValue)
139
-
140
- // We dispatch a custom event so every similar useLocalStorage hook is notified
141
- window.dispatchEvent(new StorageEvent('local-storage', { key }))
142
- } catch (error) {
143
- console.warn(`Error setting localStorage key “${key}”:`, error)
144
- }
145
- })
146
-
147
- const removeValue = useEventCallback(() => {
148
- // Prevent build error "window is undefined" but keeps working
149
- if (IS_SERVER) {
150
- console.warn(
151
- `Tried removing localStorage key “${key}” even though environment is not a client`,
152
- )
153
- }
154
-
155
- const defaultValue =
156
- initialValue instanceof Function ? initialValue() : initialValue
157
-
158
- // Remove the key from local storage
159
- window.localStorage.removeItem(key)
160
-
161
- // Save state with default value
162
- setStoredValue(defaultValue)
163
-
164
- // We dispatch a custom event so every similar useLocalStorage hook is notified
165
- window.dispatchEvent(new StorageEvent('local-storage', { key }))
166
- })
167
-
168
- useEffect(() => {
169
- setStoredValue(readValue())
170
- // eslint-disable-next-line react-hooks/exhaustive-deps
171
- }, [key])
172
-
173
- const handleStorageChange = useCallback(
174
- (event: StorageEvent | CustomEvent) => {
175
- if ((event as StorageEvent).key && (event as StorageEvent).key !== key) {
176
- return
177
- }
178
- setStoredValue(readValue())
179
- },
180
- [key, readValue],
181
- )
182
-
183
- // this only works for other documents, not the current one
184
- useEventListener('storage', handleStorageChange)
185
-
186
- // this is a custom event, triggered in writeValueToLocalStorage
187
- // See: useLocalStorage()
188
- useEventListener('local-storage', handleStorageChange)
189
-
190
- return [storedValue, setValue, removeValue]
191
- }
@@ -1 +0,0 @@
1
- export * from './useLockBody'
@@ -1,12 +0,0 @@
1
- import * as React from "react"
2
-
3
- // @see https://usehooks.com/useLockBodyScroll.
4
- export function useLockBody() {
5
- React.useLayoutEffect((): (() => void) => {
6
- const originalStyle: string = window.getComputedStyle(
7
- document.body
8
- ).overflow
9
- document.body.style.overflow = "hidden"
10
- return () => (document.body.style.overflow = originalStyle)
11
- }, [])
12
- }
@@ -1 +0,0 @@
1
- export * from './useMap'
@@ -1,83 +0,0 @@
1
- import { useCallback, useState } from 'react'
2
-
3
- /**
4
- * Represents the type for either a Map or an array of key-value pairs.
5
- * @template K - The type of keys in the map.
6
- * @template V - The type of values in the map.
7
- */
8
- type MapOrEntries<K, V> = Map<K, V> | [K, V][]
9
-
10
- /**
11
- * Represents the actions available to interact with the map state.
12
- * @template K - The type of keys in the map.
13
- * @template V - The type of values in the map.
14
- */
15
- type UseMapActions<K, V> = {
16
- /** Set a key-value pair in the map. */
17
- set: (key: K, value: V) => void
18
- /** Set all key-value pairs in the map. */
19
- setAll: (entries: MapOrEntries<K, V>) => void
20
- /** Remove a key-value pair from the map. */
21
- remove: (key: K) => void
22
- /** Reset the map to an empty state. */
23
- reset: Map<K, V>['clear']
24
- }
25
-
26
- /**
27
- * Represents the return type of the `useMap` hook.
28
- * We hide some setters from the returned map to disable autocompletion.
29
- * @template K - The type of keys in the map.
30
- * @template V - The type of values in the map.
31
- */
32
- type UseMapReturn<K, V> = [
33
- Omit<Map<K, V>, 'set' | 'clear' | 'delete'>,
34
- UseMapActions<K, V>,
35
- ]
36
-
37
- /**
38
- * Custom hook that manages a key-value [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) state with setter actions.
39
- * @template K - The type of keys in the map.
40
- * @template V - The type of values in the map.
41
- * @param {MapOrEntries<K, V>} [initialState] - The initial state of the map as a Map or an array of key-value pairs (optional).
42
- * @returns {UseMapReturn<K, V>} A tuple containing the map state and actions to interact with the map.
43
- * @public
44
- * @see [Documentation](https://usehooks-ts.com/react-hook/use-map)
45
- * @example
46
- * ```tsx
47
- * const [map, mapActions] = useMap();
48
- * // Access the `map` state and use `mapActions` to set, remove, or reset entries.
49
- * ```
50
- */
51
- export function useMap<K, V>(
52
- initialState: MapOrEntries<K, V> = new Map(),
53
- ): UseMapReturn<K, V> {
54
- const [map, setMap] = useState(new Map(initialState))
55
-
56
- const actions: UseMapActions<K, V> = {
57
- set: useCallback((key, value) => {
58
- setMap(prev => {
59
- const copy = new Map(prev)
60
- copy.set(key, value)
61
- return copy
62
- })
63
- }, []),
64
-
65
- setAll: useCallback(entries => {
66
- setMap(() => new Map(entries))
67
- }, []),
68
-
69
- remove: useCallback(key => {
70
- setMap(prev => {
71
- const copy = new Map(prev)
72
- copy.delete(key)
73
- return copy
74
- })
75
- }, []),
76
-
77
- reset: useCallback(() => {
78
- setMap(() => new Map())
79
- }, []),
80
- }
81
-
82
- return [map, actions]
83
- }
@@ -1 +0,0 @@
1
- export * from './useMediaQuery'
@@ -1,83 +0,0 @@
1
- import { useState } from 'react'
2
-
3
- import { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect'
4
-
5
- /** Hook options. */
6
- type UseMediaQueryOptions = {
7
- /**
8
- * The default value to return if the hook is being run on the server.
9
- * @default false
10
- */
11
- defaultValue?: boolean
12
- /**
13
- * If `true` (default), the hook will initialize reading the media query. In SSR, you should set it to `false`, returning `options.defaultValue` or `false` initially.
14
- * @default true
15
- */
16
- initializeWithValue?: boolean
17
- }
18
-
19
- const IS_SERVER = typeof window === 'undefined'
20
-
21
- /**
22
- * Custom hook that tracks the state of a media query using the [`Match Media API`](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia).
23
- * @param {string} query - The media query to track.
24
- * @param {?UseMediaQueryOptions} [options] - The options for customizing the behavior of the hook (optional).
25
- * @returns {boolean} The current state of the media query (true if the query matches, false otherwise).
26
- * @public
27
- * @see [Documentation](https://usehooks-ts.com/react-hook/use-media-query)
28
- * @example
29
- * ```tsx
30
- * const isSmallScreen = useMediaQuery('(max-width: 600px)');
31
- * // Use `isSmallScreen` to conditionally apply styles or logic based on the screen size.
32
- * ```
33
- */
34
- export function useMediaQuery(
35
- query: string,
36
- {
37
- defaultValue = false,
38
- initializeWithValue = true,
39
- }: UseMediaQueryOptions = {},
40
- ): boolean {
41
- const getMatches = (query: string): boolean => {
42
- if (IS_SERVER) {
43
- return defaultValue
44
- }
45
- return window.matchMedia(query).matches
46
- }
47
-
48
- const [matches, setMatches] = useState<boolean>(() => {
49
- if (initializeWithValue) {
50
- return getMatches(query)
51
- }
52
- return defaultValue
53
- })
54
-
55
- // Handles the change event of the media query.
56
- function handleChange() {
57
- setMatches(getMatches(query))
58
- }
59
-
60
- useIsomorphicLayoutEffect(() => {
61
- const matchMedia = window.matchMedia(query)
62
-
63
- // Triggered at the first client-side load and if query changes
64
- handleChange()
65
-
66
- // Use deprecated `addListener` and `removeListener` to support Safari < 14 (#135)
67
- if (matchMedia.addListener) {
68
- matchMedia.addListener(handleChange)
69
- } else {
70
- matchMedia.addEventListener('change', handleChange)
71
- }
72
-
73
- return () => {
74
- if (matchMedia.removeListener) {
75
- matchMedia.removeListener(handleChange)
76
- } else {
77
- matchMedia.removeEventListener('change', handleChange)
78
- }
79
- }
80
- }, [query])
81
-
82
- return matches
83
- }
@@ -1 +0,0 @@
1
- export * from './useOnClickOutside'
@@ -1,61 +0,0 @@
1
- import type { RefObject } from 'react'
2
-
3
- import { useEventListener } from '../useEventListener'
4
-
5
- /** Supported event types. */
6
- type EventType =
7
- | 'mousedown'
8
- | 'mouseup'
9
- | 'touchstart'
10
- | 'touchend'
11
- | 'focusin'
12
- | 'focusout'
13
-
14
- /**
15
- * Custom hook that handles clicks outside a specified element.
16
- * @template T - The type of the element's reference.
17
- * @param {RefObject<T> | RefObject<T>[]} ref - The React ref object(s) representing the element(s) to watch for outside clicks.
18
- * @param {(event: MouseEvent | TouchEvent | FocusEvent) => void} handler - The callback function to be executed when a click outside the element occurs.
19
- * @param {EventType} [eventType] - The mouse event type to listen for (optional, default is 'mousedown').
20
- * @param {?AddEventListenerOptions} [eventListenerOptions] - The options object to be passed to the `addEventListener` method (optional).
21
- * @returns {void}
22
- * @public
23
- * @see [Documentation](https://usehooks-ts.com/react-hook/use-on-click-outside)
24
- * @example
25
- * ```tsx
26
- * const containerRef = useRef(null);
27
- * useOnClickOutside([containerRef], () => {
28
- * // Handle clicks outside the container.
29
- * });
30
- * ```
31
- */
32
- export function useOnClickOutside<T extends HTMLElement = HTMLElement>(
33
- ref: RefObject<T> | RefObject<T>[],
34
- handler: (event: MouseEvent | TouchEvent | FocusEvent) => void,
35
- eventType: EventType = 'mousedown',
36
- eventListenerOptions: AddEventListenerOptions = {},
37
- ): void {
38
- useEventListener(
39
- eventType,
40
- event => {
41
- const target = event.target as Node
42
-
43
- // Do nothing if the target is not connected element with document
44
- if (!target || !target.isConnected) {
45
- return
46
- }
47
-
48
- const isOutside = Array.isArray(ref)
49
- ? ref
50
- .filter(r => Boolean(r.current))
51
- .every(r => r.current && !r.current.contains(target))
52
- : ref.current && !ref.current.contains(target)
53
-
54
- if (isOutside) {
55
- handler(event)
56
- }
57
- },
58
- undefined,
59
- eventListenerOptions,
60
- )
61
- }
@@ -1 +0,0 @@
1
- export * from "./useQueryString"
@@ -1,26 +0,0 @@
1
- import { useCallback } from 'react';
2
-
3
- type Nullable<T> = {
4
- [P in keyof T]: T[P] | null;
5
- };
6
- type QueryParamsValue = Nullable<string | number | boolean | undefined>
7
- type QueryParams = Record<string, QueryParamsValue>
8
-
9
- export const useQueryString = (searchParams: URLSearchParams) => {
10
-
11
- const createQueryString = useCallback((baseUrl: string, params: QueryParams) => {
12
- const newSearchParams = new URLSearchParams(searchParams?.toString());
13
-
14
- Object.entries(params).forEach(([key, value]) => {
15
- if (value === null || value === "" || value === undefined) {
16
- newSearchParams.delete(key);
17
- } else {
18
- newSearchParams.set(key, String(value));
19
- }
20
- });
21
-
22
- return `${baseUrl}?${newSearchParams.toString()}`;
23
- }, [searchParams],);
24
-
25
- return { createQueryString, };
26
- };
@@ -1 +0,0 @@
1
- export * from './useReadLocalStorage'
@@ -1,122 +0,0 @@
1
- import { useCallback, useEffect, useState } from 'react'
2
-
3
- import { useEventListener } from '../useEventListener'
4
-
5
- const IS_SERVER = typeof window === 'undefined'
6
-
7
- /**
8
- * Represents the type for the options available when reading from local storage.
9
- * @template T - The type of the stored value.
10
- */
11
- type Options<T, InitializeWithValue extends boolean | undefined> = {
12
- /** Custom deserializer function to convert the stored string value to the desired type (optional). */
13
- deserializer?: (value: string) => T
14
- /** If `true` (default), the hook will initialize reading the local storage. In SSR, you should set it to `false`, returning `undefined` initially. */
15
- initializeWithValue: InitializeWithValue
16
- }
17
-
18
- // SSR version
19
- export function useReadLocalStorage<T>(
20
- key: string,
21
- options: Options<T, false>,
22
- ): T | null | undefined
23
- // CSR version
24
- export function useReadLocalStorage<T>(
25
- key: string,
26
- options?: Partial<Options<T, true>>,
27
- ): T | null
28
- /**
29
- * Custom hook that reads a value from [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage), closely related to [`useLocalStorage()`](https://usehooks-ts.com/react-hook/use-local-storage).
30
- * @template T - The type of the stored value.
31
- * @param {string} key - The key associated with the value in local storage.
32
- * @param {Options<T>} [options] - Additional options for reading the value (optional).
33
- * @returns {T | null | undefined} The stored value, or null if the key is not present or an error occurs.
34
- * @public
35
- * @see [Documentation](https://usehooks-ts.com/react-hook/use-read-local-storage)
36
- * @example
37
- * ```tsx
38
- * const storedData = useReadLocalStorage('myKey');
39
- * // Access the stored data from local storage.
40
- * ```
41
- */
42
- export function useReadLocalStorage<T>(
43
- key: string,
44
- options: Partial<Options<T, boolean>> = {},
45
- ): T | null | undefined {
46
- let { initializeWithValue = true } = options
47
- if (IS_SERVER) {
48
- initializeWithValue = false
49
- }
50
-
51
- const deserializer = useCallback<(value: string) => T | null>(
52
- value => {
53
- if (options.deserializer) {
54
- return options.deserializer(value)
55
- }
56
- // Support 'undefined' as a value
57
- if (value === 'undefined') {
58
- return undefined as unknown as T
59
- }
60
-
61
- let parsed: unknown
62
- try {
63
- parsed = JSON.parse(value)
64
- } catch (error) {
65
- console.error('Error parsing JSON:', error)
66
- return null
67
- }
68
-
69
- return parsed as T
70
- },
71
- [options],
72
- )
73
-
74
- // Get from local storage then
75
- // parse stored json or return initialValue
76
- const readValue = useCallback((): T | null => {
77
- // Prevent build error "window is undefined" but keep keep working
78
- if (IS_SERVER) {
79
- return null
80
- }
81
-
82
- try {
83
- const raw = window.localStorage.getItem(key)
84
- return raw ? deserializer(raw) : null
85
- } catch (error) {
86
- console.warn(`Error reading localStorage key “${key}”:`, error)
87
- return null
88
- }
89
- }, [key, deserializer])
90
-
91
- const [storedValue, setStoredValue] = useState(() => {
92
- if (initializeWithValue) {
93
- return readValue()
94
- }
95
- return undefined
96
- })
97
-
98
- // Listen if localStorage changes
99
- useEffect(() => {
100
- setStoredValue(readValue())
101
- // eslint-disable-next-line react-hooks/exhaustive-deps
102
- }, [key])
103
-
104
- const handleStorageChange = useCallback(
105
- (event: StorageEvent | CustomEvent) => {
106
- if ((event as StorageEvent).key && (event as StorageEvent).key !== key) {
107
- return
108
- }
109
- setStoredValue(readValue())
110
- },
111
- [key, readValue],
112
- )
113
-
114
- // this only works for other documents, not the current one
115
- useEventListener('storage', handleStorageChange)
116
-
117
- // this is a custom event, triggered in writeValueToLocalStorage
118
- // See: useLocalStorage()
119
- useEventListener('local-storage', handleStorageChange)
120
-
121
- return storedValue
122
- }
@@ -1 +0,0 @@
1
- export * from './useResizeObserver'