{"_id":"@amcinox/hooks","_rev":"1-855c11dd90221e9f2aed9bea7b3cab64","name":"@amcinox/hooks","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@amcinox/hooks","version":"1.0.0","description":"","main":"./build/index.js","types":"./build/index.d.ts","scripts":{"clean":"del ./build/*","build":"tsc","pub":"git add . && git commit -m \"Updates\" && npm version patch && npm run build && npm publish","pub2":"tsc && git add . && git commit -m \"Updates\" && npm version patch && npm run build && npm publish && git push"},"keywords":[],"author":{"name":"Amcinox"},"license":"ISC","devDependencies":{"@types/react":"^18.0.26","del-cli":"^3.0.0","typescript":"^3.8.3"},"dependencies":{"@xobotyi/scrollbar-width":"^1.9.5","copy-to-clipboard":"^3.3.3","fast-shallow-equal":"^1.0.0","js-cookie":"^3.0.1","nano-css":"^5.3.5","react":"^18.2.0","react-dom":"^18.2.0","react-universal-interface":"^0.6.2","resize-observer-polyfill":"^1.5.1","screenfull":"^6.0.2","set-harmonic-interval":"^1.0.1","throttle-debounce":"^5.0.0","ts-easing":"^0.2.0"},"gitHead":"ecfd4f0150bfd1649edfea70b93b62b582026ef2","_id":"@amcinox/hooks@1.0.0","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-tTas8349f8L1idn8CoW8ffVIWpUIOz0tlgKFJ/RmIKBPJDmm4ynaB47/eULAMXTaEIzs7tt5XhqeHBPmkv8kjQ==","shasum":"3ca7b5f51ac26c764aa250dfcc674e902613a36a","tarball":"https://registry.npmjs.org/@amcinox/hooks/-/hooks-1.0.0.tgz","fileCount":256,"unpackedSize":245444,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICahdFHBqJhdhjTb6hjk08uPXGzojM4xDAwzzNUUkiKEAiEAn/T5IT0n1Z29bTNKcPwIi93EZsx9Vz0jJMoIDJDmnpw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjrf1VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqzVw/7BWlTV+XyD8B/vllEpHVHRZFYCOGDbxE1UEDxSaR03xS0rGSc\r\nVWQliBYOhgduFOJuQTiQNpqlgI1CNxdxsiqY5/HkLQuh8lIBRV7MCIXnanvy\r\nY9TeGIy6gmlH7KQaB2+fTSqVdAXQ9xajUytbqvMgoGDrmiWzu1tDIqZRb87N\r\nNOLa6DEcRTvJKGZXKcFQJB2X4+1BugS3jprnZT7IudR38ZDdqI5fjvDpQRF/\r\nrxv5KQiUJX9wnf5HaoPNhJnlFP39Fyf39hSvm6o/Z6cuttrDkW2qp5QXvAIk\r\nbHUaCMdLMWkbh2fT8GqPxkR5jt/USbneZS6XyhO7zdohhengoDaxHbLeTUsz\r\nLHxFA/9VwbSL8HD5NhWphRJIZsqnpey9zSZVrhLbdqt3PyYegOecGejUntGW\r\nHRJBVzRj8czHrt5939PPYPFVlzKMmbN40448JujVO1lA95WRqATUVCbgOYld\r\nfpjTVNBZBw2jQwNwCCBnR68flnE6pyEHNK80/ibaYHKv7Gmtquwd+Lji61Ux\r\ng5dWRz1nb+Ny/J6lY78Wg+3XefkU1G74VtUzhIM2BcXHTLJhD4wpo58jfqxE\r\nwnV3NkJWfiZ3gEoM1UC9e+gFs6vQk9pJzvuNA5ix9WCcWieBEXP89npCCmfz\r\n0h5MxPcNFghgb5/S3LZrCMqG2EINn+bJlI0=\r\n=LqHf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"amcinox","email":"amcinox@gmail.com"},"directories":{},"maintainers":[{"name":"amcinox","email":"amcinox@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hooks_1.0.0_1672346965446_0.7130217390428781"},"_hasShrinkwrap":false},"1.0.1":{"name":"@amcinox/hooks","version":"1.0.1","description":"- ## Sensors","main":"./build/index.js","types":"./build/index.d.ts","scripts":{"clean":"del ./build/*","build":"tsc","pub":"git add . && git commit -m \"Updates\" && npm version patch && npm run build && npm publish","pub2":"tsc && git add . && git commit -m \"Updates\" && npm version patch && npm run build && npm publish && git push"},"keywords":[],"author":{"name":"Amcinox"},"license":"ISC","devDependencies":{"@types/react":"^18.0.26","del-cli":"^3.0.0","typescript":"^3.8.3"},"dependencies":{"@xobotyi/scrollbar-width":"^1.9.5","copy-to-clipboard":"^3.3.3","fast-shallow-equal":"^1.0.0","js-cookie":"^3.0.1","nano-css":"^5.3.5","react":"^18.2.0","react-dom":"^18.2.0","react-universal-interface":"^0.6.2","resize-observer-polyfill":"^1.5.1","screenfull":"^6.0.2","set-harmonic-interval":"^1.0.1","throttle-debounce":"^5.0.0","ts-easing":"^0.2.0"},"gitHead":"ecfd4f0150bfd1649edfea70b93b62b582026ef2","_id":"@amcinox/hooks@1.0.1","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-fLDOTpc4nKsSSq/3OSMXVuZMp+HpCvYXQJmha9IyTRflHL5a1LAWzz4q54cojOlK+wAn+WQaihgZcH//jvQU4Q==","shasum":"dba00ec55287b231591b82d124077360c3138d39","tarball":"https://registry.npmjs.org/@amcinox/hooks/-/hooks-1.0.1.tgz","fileCount":257,"unpackedSize":251759,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFrM5gPm4HXsji3CgO/BCb48He2bKjUEesNsxjrgCzJyAiAkkimD9Y/aHmgk9idO7MTp5uj4bdDicTudKm4IzBT1tw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjrf3PACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo4dA//cpz9WNpJB9ilJoGuETpscRYZNVSOy8LmQ3b6YDvo32OXbBmU\r\n1xrntsCoR8WVexIqZhGiFu8QZwI83gZbxhQNpsy9fPFBCkLqHTEyOfQJXzor\r\nqY8SbLy8Ec3h1HLpSDsiMb2doHwrLiqz+W3bfGWcs10eYYftipLflljvCqWZ\r\nh8TudE/i8CX8fkZVg+l4mPzHDUT62RhJCjsLDtTdmRKByyjJQoY64H1Lu9Er\r\nS9nxbPcqhmHOc/OnA2ZUhwkWVXJc70mzvGWXGSm7p+OtX4ZYf54iH+cZ6Ly0\r\npV40vTOk1pexmOK0oGotdveLrOxi0AHvqFIoWSR4JKk9E+P7HVmAXAFNEdVB\r\nDpxO5rhAAm2nhqzOf3Qom6jT1o6h+r77nzS+UX6dMa14EjjjzTjjfIVJ3/RI\r\nY/CmSWiipjsPtbRtA+UEEcXMCz7Vf50/yYIbhaho+p+ioDPJfLALL7Nyq3yh\r\nvTWr4MTqBhl9Wpvbge8H1Yd/iO/Ga/h+1K8xyAdQslT75NcFny7oqFezkiw+\r\nZrdVaaWfQUUAQEC+cE0hGs84jmoqqqvoPUeBCxHrFJzB7oOcfVqRw9x56xca\r\ngX760Ypr+CiDAKzwl0CEjOi9fK/S+Fxote/G4SDAhcrgNLzOTrsJmWhnDUTZ\r\nSDM+b+Ky71Dx7j/A45Ig2NVyRJ0boKwTzfw=\r\n=zj4E\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"amcinox","email":"amcinox@gmail.com"},"directories":{},"maintainers":[{"name":"amcinox","email":"amcinox@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hooks_1.0.1_1672347087681_0.47730176011085157"},"_hasShrinkwrap":false}},"time":{"created":"2022-12-29T20:49:25.322Z","1.0.0":"2022-12-29T20:49:25.692Z","modified":"2022-12-29T20:51:27.967Z","1.0.1":"2022-12-29T20:51:27.851Z"},"maintainers":[{"name":"amcinox","email":"amcinox@gmail.com"}],"keywords":[],"author":{"name":"Amcinox"},"license":"ISC","readme":"# Hooks\n\n- ## Sensors\n\n* `useBattery` — tracks device battery state.\n* `useGeolocation` — tracks geo location state of user's device.\n* `useHover` and `useHoverDirty` — tracks mouse hover state of some element.\n* `useHash` — tracks location hash value.\n* `useIdle` — tracks whether user is being inactive.\n* `useIntersection` — tracks an HTML element's intersection.\n* `useKey`, `useKeyPress`, useKeyboardJs, and useKeyPressEvent — track keys.\n* `useLocation` and `useSearchParam` — tracks page navigation bar location state.\n* `useLongPress` — tracks long press gesture of some element.\n* `useMedia` — tracks state of a CSS media query.\n* `useMediaDevices` — tracks state of connected hardware devices.\n* `useMotion` — tracks state of device's motion sensor.\n* `useMouse` and `useMouseHovered` — tracks state of mouse position.\n* `useMouseWheel` — tracks deltaY of scrolled mouse wheel.\n* `useNetworkState` — tracks the state of browser's network connection.\n* `useOrientation` — tracks state of device's screen orientation.\n* `usePageLeave` — triggers when mouse leaves page boundaries.\n* `useScratch` — tracks mouse click-and-scrub state.\n* `useScroll` — tracks an HTML element's scroll position.\n* `useScrolling` — tracks whether HTML element is scrolling.\n* `useStartTyping` — detects when user starts typing.\n* `useWindowScroll` — tracks Window scroll position.\n* `useWindowSize` — tracks Window dimensions.\n* `useMeasure` and `useSize` — tracks an HTML element's dimensions.\n* `createBreakpoint` — tracks innerWidth\n* `useScrollbarWidth` — detects browser's native scrollbars width.\n* `usePinchZoom` — tracks pointer events to detect pinch zoom in and out status.\n\n- ## UI\n\n* `useAudio` — plays audio and exposes its controls.\n* `useClickAway` — triggers callback when user clicks outside target area.\n* `useCss` — dynamically adjusts CSS.\n* `useDrop` and `useDropArea` — tracks file, link and copy-paste drops.\n* `useFullscreen` — display an element or video full-screen.\n* `useSlider` — provides slide behavior over any HTML element.\n* `useSpeech` — synthesizes speech from a text string.\n* `useVibrate` — provide physical feedback using the Vibration API.\n* `useVideo` — plays video, tracks its state, and exposes playback controls.\n\n- ## Animations\n\n* `useRaf` — re-renders component on each requestAnimationFrame.\n* `useInterval` and `useHarmonicIntervalFn` — re-renders component on a set interval using setInterval.\n* `useSpring` — interpolates number over time according to spring dynamics.\n* `useTimeout` — re-renders component after a timeout.\n* `useTimeoutFn` — calls given function after a timeout.\n* `useTween` — re-renders component, while tweening a number from 0 to 1.\n* `useUpdate` — returns a callback, which re-renders component when called.\n\n- ## Side-effects\n\n* `useAsync`, `useAsyncFn`, and `useAsyncRetry` — resolves an async function.\n* `useBeforeUnload` — shows browser alert when user try to reload or close the page.\n* `useCookie` — provides way to read, update and delete a cookie.\n* `useCopyToClipboard` — copies text to clipboard.\n* `useDebounce` — debounces a function.\n* `useError` — error dispatcher.\n* `useFavicon` — sets favicon of the page.\n* `useLocalStorage` — manages a value in localStorage.\n* `useLockBodyScroll` — lock scrolling of the body element.\n* `useRafLoop` — calls given function inside the RAF loop.\n* `useSessionStorage` — manages a value in sessionStorage.\n* `useThrottle` and useThrottleFn — throttles a function.\n* `useTitle` — sets title of the page.\n* `usePermission` — query permission status for browser APIs.\n\n- ## Lifecycles\n\n* `useEffectOnce` — a modified `useEffect` hook that only runs once.\n* `useEvent` — subscribe to events.\n* `useLifecycles` — calls mount and unmount callbacks.\n* `useMountedState` and `useUnmountPromise` — track if component is mounted.\n* `usePromise` — resolves promise only while component is mounted.\n* `useLogger` — logs in console as component goes through life-cycles.\n* `useMount` — calls mount callbacks.\n* `useUnmount` — calls unmount callbacks.\n* `useUpdateEffect` — run an effect only on updates.\n* `useIsomorphicLayoutEffect` — `useLayoutEffect` that that works on server.\n* `useDeepCompareEffect`, `useShallowCompareEffect`, and `useCustomCompareEffect`\n\n- ## State\n\n* `createMemo` — factory of memoized hooks.\n* `createReducer` — factory of reducer hooks with custom middleware.\n* `createReducerContext` and createStateContext — factory of hooks for a sharing state between components.\n* `useDefault` — returns the default value when state is null or undefined.\n* `useGetSet` — returns state getter get() instead of raw state.\n* `useGetSetState` — as if useGetSet and useSetState had a baby.\n* `useLatest` — returns the latest state or props\n* `usePrevious` — returns the previous state or props.\n* `usePreviousDistinct` — like usePrevious but with a predicate to determine if previous should update.\n* `useObservable` — tracks latest value of an Observable.\n* `useRafState` — creates setState method which only updates after requestAnimationFrame.\n* `useSetState` — creates setState method which works like this.setState.\n* `useStateList` — circularly iterates over an array.\n* `useToggle` and `useBoolean` — tracks state of a boolean.\n* `useCounter` and `useNumber` — tracks state of a number.\n* `useList` and useUpsert — tracks state of an array.\n* `useMap` — tracks state of an object.\n* `useSet` — tracks state of a Set.\n* `useQueue` — implements simple queue.\n* `useStateValidator` — tracks state of an object.\n* `useStateWithHistory` — stores previous state values and provides handles to travel through them.\n* `useMultiStateValidator` — alike the useStateValidator, but tracks multiple states at a time.\n* `useMediatedState` — like the regular useState but with mediation by custom function.\n* `useFirstMountState` — check if current render is first.\n* `useRendersCount` — count component renders.\n* `createGlobalState` — cross component shared state.\n* `useMethods` — neat alternative to useReducer.\n\n- ## Miscellaneous\n\n* `useEnsuredForwardedRef` and `ensuredForwardRef` — use a React.forwardedRef safely.\n","readmeFilename":"README.md","description":"- ## Sensors"}