{"_id":"@ashalfarhan/hooks","_rev":"5-7d2e9ad4176b161f7d7fe060b6e3f8ff","name":"@ashalfarhan/hooks","dist-tags":{"latest":"0.2.3"},"versions":{"0.1.0":{"name":"@ashalfarhan/hooks","version":"0.1.0","license":"MIT","main":"dist/index.js","author":{"name":"ashalfarhan"},"module":"dist/hooks.esm.js","typings":"dist/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/ashalfarhan/hooks.git"},"keywords":["react","react-hooks","hooks","use-scroll","usescroll"],"engines":{"node":">=12"},"publishConfig":{"access":"public"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test --passWithNoTests","lint":"tsdx lint","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why"},"peerDependencies":{"react":">=16"},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"size-limit":[{"path":"dist/hooks.cjs.production.min.js","limit":"10 KB"},{"path":"dist/hooks.esm.js","limit":"10 KB"}],"devDependencies":{"@size-limit/preset-small-lib":"^5.0.1","@types/react":"^17.0.14","@types/react-dom":"^17.0.9","husky":"^7.0.1","react":"^17.0.2","react-dom":"^17.0.2","size-limit":"^5.0.1","tsdx":"^0.14.1","tslib":"^2.3.0","typescript":"^4.3.5"},"gitHead":"a557ddc3fedd9654f1d1dd94f659c634962477a3","description":"## Description","bugs":{"url":"https://github.com/ashalfarhan/hooks/issues"},"homepage":"https://github.com/ashalfarhan/hooks#readme","_id":"@ashalfarhan/hooks@0.1.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-Ni2sCvOWcXaduKrlB5vZSTQkzWqaOKYdYQj2ZL4RA9Aa2r9/5oU8Jjj6XWKcEjGYUDHAVDY7cEivW+CLnnZMAw==","shasum":"e2e505b0306f2f4de526bf4950ebec8f478b4014","tarball":"https://registry.npmjs.org/@ashalfarhan/hooks/-/hooks-0.1.0.tgz","fileCount":12,"unpackedSize":15926,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6pE7CRA9TVsSAnZWagAAMnAP/3+7jtL2nrQpm8q+u1jn\nOmIp74uAlj8TXiaasow1WLStOyTTqbDqtgPrd+o96d9B2g8izbjpwoz30pcu\nazBlgexWee7GrVoJzGT/cXSPrgNA/JtIFlVFfFk5Ah9GVcT6u3xWzRdHtQTk\nSCQaN79w+JpSdvsvITPlp5SDSzC8aO4jkOEzCYkbut2TdCqfNyuNxwRjWSSu\nlf7m3Rl4RMFIGl4YCoW3uzqZgJjFSj0nyrLWv4fPIef7PM0RtXVd4pe5E0+v\nZ74NsSMIwPtTUkipJTwPBV4RGOV84gu6fXtFzSqtFhGwtr0v48SegK7t5x6W\nOBHMHPDBIi3y4M5+VE098EXZIU45Xftr2c1elIhktcnC+bOxIip/wC3h4np4\nVKp+6JlXxAt0zG2SONGTTV+kMtq3uCQg/72FHCLV5klvlbDLRROYXcaWTDfh\nJmPPtFg0KiIthOH3+0fRnc/hQGeW0shoV2zsmgDmFV72B4ba7A+vvqolcxVp\n3jDifgNeFyY5oY4dJ5ZKmnEVRf5QlSWLO8aKdJirW7xEE6l/9WYJy6pFz+8J\nu4Ex9evzGD8ztC1obKMbqOD9utICUgCv7FIN9JVsipaWrn8Dmz5ZMYDY5mhp\nzP7cGKfV/ycoJbTJ08JX5MI6VBUw4JODim/bkAKUzgsjrAWbBFvXjfCj7H7h\nTrI0\r\n=iKRo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDLd3XpH2O+B2Lbgll+VfoHoaPalfUnXTCD/dG1rGSgDAiEAw+0+9B55WEAt53tQ1bziN2GPk9KEEcwGlfknSMrbmW4="}]},"_npmUser":{"name":"ashalfarhan","email":"ashalfarhan8@gmail.com"},"directories":{},"maintainers":[{"name":"ashalfarhan","email":"ashalfarhan8@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hooks_0.1.0_1625985338547_0.7746074709753568"},"_hasShrinkwrap":false},"0.2.0":{"name":"@ashalfarhan/hooks","version":"0.2.0","license":"MIT","main":"dist/index.js","author":{"name":"ashalfarhan"},"module":"dist/hooks.esm.js","typings":"dist/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/ashalfarhan/hooks.git"},"keywords":["react","react-hooks","hooks","use-scroll","useScroll","use-fetch","useFetch","useToggle","use-toggle"],"engines":{"node":">=12"},"publishConfig":{"access":"public"},"scripts":{"start":"tsdx watch","build":"tsdx build","test:unit":"tsdx test --passWithNoTests","test:e2e":"cypress run","lint":"tsdx lint","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why"},"peerDependencies":{"react":">=16"},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"size-limit":[{"path":"dist/hooks.cjs.production.min.js","limit":"10 KB"},{"path":"dist/hooks.esm.js","limit":"10 KB"}],"devDependencies":{"@size-limit/preset-small-lib":"^5.0.1","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^12.0.0","@testing-library/react-hooks":"^7.0.1","@testing-library/user-event":"^13.1.9","@types/react":"^17.0.14","@types/react-dom":"^17.0.9","cypress":"^7.7.0","husky":"^7.0.1","jest-fetch-mock":"^3.0.3","react":"^17.0.2","react-dom":"^17.0.2","size-limit":"^5.0.1","tsdx":"^0.14.1","tslib":"^2.3.0","typescript":"^4.3.5"},"gitHead":"26dd67cda0cab58bfdd16b33aa887d4d59b4b672","description":"## 📦 Installation","bugs":{"url":"https://github.com/ashalfarhan/hooks/issues"},"homepage":"https://github.com/ashalfarhan/hooks#readme","_id":"@ashalfarhan/hooks@0.2.0","_nodeVersion":"12.22.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-r7X9spCcat7DunkIbF8oysmLW37W/qDw437Jrw2f7fjw4Qfp2VZlnEueHobGzoFOW4xyJs6V/AQl16El3oW9HA==","shasum":"fb8ef1352705e8f676af737ee779660800ab6f1a","tarball":"https://registry.npmjs.org/@ashalfarhan/hooks/-/hooks-0.2.0.tgz","fileCount":20,"unpackedSize":233054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8HZPCRA9TVsSAnZWagAASGUP/jzcmfvp3mmkXIM1Zfng\nmnMh3KxKahKZpJJWYsNPzpKYlXgQfMfGDofxUbU65n0Apv3ojhXOmxRufC69\nLO39ifYQL7IxmuYQTPAYO7hPlgpCX+uYHefYoslpPVsBRKQVYw1JyAuocnG3\ns2Wbo4TAgjIFwBdFNK0rlWBeVFen9XSvUq1ccvVqMMBd8cltT7x7vjQtc2Tx\n5YxYGMH3EExpgScC4DlXsSiFkkCNWTs1PQd4xEX+L9evDaaqMQJbA+/s61uX\ndO+ivIJck8jR7zQa78Y6kJ8wjY2hEBRl1BZKPbprEhjqPxpwrn3eaWj9mmyk\nQ707+vJC8Q2QC2URqa76od/dlG4yUQyJTX1Hys6tknkDfETQ8mqdAYBSmNFZ\n2tUt7+Jfhp2GqMErF5Obu4CW288qhCPiPABA0ZpjIc3x21e6A5znxBqKvlxL\nUXPoM6CLJ60ayE09lDcOuHv0EAz7lhK0/boy3F5yxjWEFgCSwDnAZ+pDppxn\nFZslxQ+Bz6uJjkpMe6hEe/fkmG5nM0BdhsCUQ7Jtn/MlaYZ3qgwSS7NBXEKp\nk3yWFhVr4FE6vzrWjnuz39lkrmD5DmPjGuh0JpNtVZQhUbZUydLoq4uLyCYk\nMGKp4n2A+hjH4g+OR5yGozFsCjhoR4fS5BIMbXhy7tZlT9WjDufWLsp28P5C\nj+iZ\r\n=+mw7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBn1Ldq4qVLquN6dHmFZGxva2c/zixVjFEIbUcXiqMonAiEAtko69lrsiqv/EI6QvpLItZmiCrRwRScf7jzc8OsZNOU="}]},"_npmUser":{"name":"ashalfarhan","email":"ashalfarhan8@gmail.com"},"directories":{},"maintainers":[{"name":"ashalfarhan","email":"ashalfarhan8@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hooks_0.2.0_1626371663577_0.4243889091437252"},"_hasShrinkwrap":false},"0.2.2":{"name":"@ashalfarhan/hooks","version":"0.2.2","license":"MIT","main":"dist/index.js","author":{"name":"ashalfarhan"},"module":"dist/hooks.esm.js","typings":"dist/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/ashalfarhan/hooks.git"},"keywords":["react","react-hooks","hooks","use-scroll","useScroll","use-fetch","useFetch","useToggle","use-toggle"],"engines":{"node":">=12"},"publishConfig":{"access":"public"},"scripts":{"start":"tsdx watch","build":"tsdx build","test:unit":"tsdx test --passWithNoTests","test:e2e":"cypress run","lint":"tsdx lint","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why"},"peerDependencies":{"react":">=16"},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"size-limit":[{"path":"dist/hooks.cjs.production.min.js","limit":"10 KB"},{"path":"dist/hooks.esm.js","limit":"10 KB"}],"devDependencies":{"@size-limit/preset-small-lib":"^5.0.1","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^12.0.0","@testing-library/react-hooks":"^7.0.1","@testing-library/user-event":"^13.1.9","@types/react":"^17.0.14","@types/react-dom":"^17.0.9","cypress":"^7.7.0","husky":"^7.0.1","jest-fetch-mock":"^3.0.3","react":"^17.0.2","react-dom":"^17.0.2","size-limit":"^5.0.1","tsdx":"^0.14.1","tslib":"^2.3.0","typescript":"^4.3.5"},"gitHead":"4fa3b8b5dac629af019efe6f3a2175f17c47d76f","description":"> Just a simple React Hooks","bugs":{"url":"https://github.com/ashalfarhan/hooks/issues"},"homepage":"https://github.com/ashalfarhan/hooks#readme","_id":"@ashalfarhan/hooks@0.2.2","_nodeVersion":"12.22.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-L7krw0BkmwB4ZSgZR2rCH5mMEti/J+u6SedF9elCFwsrAMXMv+o0KdmlGyD8uD6REPbPfTQtrlspYbr6DEHs5g==","shasum":"0ba6aee19265d5a8cb49fb3b11815b8bc8a3c203","tarball":"https://registry.npmjs.org/@ashalfarhan/hooks/-/hooks-0.2.2.tgz","fileCount":20,"unpackedSize":233160,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8IEWCRA9TVsSAnZWagAA80AP/ie4LepHYzWS7AJkAH3Q\nqH9TvVAPd7pCafm90imyb766z6+W2R3qXV6B0MwYt5PuNF2qKSKCOIzrLRIE\npgppC4qxSC0FfN7IoN3IR77/kzO2QJsQHFl7UGdCFUsLbp5Q9A1JeF46dx2A\nUBHjNq4ueV4us17akwhjBkNrOezVYZqf6SJ8aSn0klo7YABloO9St/63SyZe\ncb5f/QtUj0tv7Si5As9Y6d/y3XrrGasOFB5N4ufsyKo2aP281WmdO1SIrMRB\nW3coXzGtPDdN8+qOAW8WU+xBgwK0iVxFEsZgHO1TKmkEPwIr5H7OWNGXt3Sn\nYSR80l2Pd2pbyxaR6b3vizLefojoCPTh+XCo3QG/f+TuNOQqPas079SEX33Q\nq7pq1brh+LxfUkV5PgPqg+ZqgtLuaSjd83d+htPPSxhtO4aHx3T74CxUXy1l\n0tSCfnxUxTYgZGScyq3lKpAfqcArQzD0yIsK7zK5P4diNeIywOa+UpdGtNlh\nH5506KIzvCTY60pnMtOx1bHWgKcF9RaaLRLeuzjTxM7uZcNKmVkaUEmR/nHs\n8UkVa9r9IOoCRMBXw0TitSx8owMSgY+ev8DqAHjgCH9FCl99T8eo8gByBxuj\nQsvsbnZq+n66c1gCk96aQ1L+D8bbRpdWcOE5XOPkbAXeNhqx8Lfe6t8a5OoM\n0YkC\r\n=EAz0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDwGefpHJhTNwo20DJ2+Vmez8YBHMzX31Gm7KUOModjfAiAsZCDIzG1zcKAsiroG+FLNeVczuBdsYDxkqP84D62EjA=="}]},"_npmUser":{"name":"ashalfarhan","email":"ashalfarhan8@gmail.com"},"directories":{},"maintainers":[{"name":"ashalfarhan","email":"ashalfarhan8@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hooks_0.2.2_1626374422669_0.22159251242030797"},"_hasShrinkwrap":false},"0.2.3":{"name":"@ashalfarhan/hooks","version":"0.2.3","license":"MIT","main":"dist/index.js","author":{"name":"ashalfarhan"},"module":"dist/hooks.esm.js","typings":"dist/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/ashalfarhan/hooks.git"},"keywords":["react","react-hooks","hooks","useToggle","use-toggle","useSafeUpdate","use-safe-update","useDebouncedValue","use-debounced-value"],"engines":{"node":">=12"},"publishConfig":{"access":"public"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test --passWithNoTests","test:ci":"tsdx test --ci --coverage --verbose --maxWorkers=2","lint":"tsdx lint","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why"},"peerDependencies":{"react":">=16"},"husky":{"hooks":{"pre-commit":"tsdx lint --fix"}},"size-limit":[{"path":"dist/hooks.cjs.production.min.js","limit":"10 KB"},{"path":"dist/hooks.esm.js","limit":"10 KB"}],"devDependencies":{"@size-limit/preset-small-lib":"^6.0.4","@testing-library/react":"^12.1.2","@testing-library/react-hooks":"^7.0.2","@testing-library/user-event":"^13.5.0","@types/react":"^17.0.34","@types/react-dom":"^17.0.11","husky":"^7.0.4","react":"^17.0.2","react-dom":"^17.0.2","size-limit":"^6.0.4","ts-jest":"^27.0.7","tsdx":"^0.14.1","tslib":"^2.3.1","typescript":"^4.3.5"},"gitHead":"8676ce4b9e5a0d5898b0d4147aa23f1468174829","description":"> Just a simple React Hooks","bugs":{"url":"https://github.com/ashalfarhan/hooks/issues"},"homepage":"https://github.com/ashalfarhan/hooks#readme","_id":"@ashalfarhan/hooks@0.2.3","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-FWqqDHs8CJOlAmgh9rUWWiSBpwcHGOUC3tPqKoaaGXDmh0CrI6oLEE/NI+C+IFnlZyWI/s6o8ivDMJ8imv2x3Q==","shasum":"48bfb668ad9f4e07bde30d1971e7060b3d04ebfc","tarball":"https://registry.npmjs.org/@ashalfarhan/hooks/-/hooks-0.2.3.tgz","fileCount":22,"unpackedSize":26178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh119MCRA9TVsSAnZWagAAAv4P/2jzzW+IGMYPq83fJ+pL\nbI35DkI+Mez1Dky2R0rdtceDfs9rhojGEXWJBPh/CsdC0OAv5W3SThjpn4RH\n56eunEfHfEiXOodQGr6dWqnE1y8QoMNWm0WpNtJJ2uuvxLaaL/T8bu4hEnhX\n32aWIY6BBRflPDmWSKETVVY6bhOSIwHsuXEHOm+Kp6P46/De9f3mX9AZHbRc\n+OPVx29bSpi8wI7aSPYlfqsZ8lYrHtH4boU+T9l+ISNQZ4r6KAlZ5N8t70fn\nCLEeTEOnZODEuC3CXnIxgZVzIyAjYVofGnKzT6RTf8HMz1e/rvNAEGdCwoil\n22fvJWdNHWwQs3XtUy3vkQsNGS5zNndS+9hmk98bpZ6eX3wt70KD8hGvbWwR\nK3pS7wGGEUKoCaZMZyYMbspNBy04jAnHQFYcbSvLZQwDKmHOvp9qFGF+mqnt\nrYmM/b014//HZu0Tj0FyFd83ZJfNzAV9uiduI4Zv+wrHSrPfcziIqFPygJdk\nTP0m+RBRR2FS/yub20MTXnA5bWbed8k9S9T+DMbJySWBWQ9ZFGVnh3T+pwBi\ncYEbLVOoZ6/g7BRJzJ8Ml0IwP8W4zBY1Hs/9SNXcyRsYIpMZnFUXmLXDxYKM\np9u8Q9yK3BAgTuZP518B7XNnws4/XQvA632hZG+E/TUi5FZMEvXSfT2JGt0G\n3caD\r\n=rlVD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH4uzw0giIcNaGHPKZ4DeFmgNNw7PGPC5V49mvPsE0h+AiAPd3+WbPW0c9P8/e8lr+P6Vj05UgvnInyZrZJSe0AY9A=="}]},"_npmUser":{"name":"ashalfarhan","email":"ashalfarhan8@gmail.com"},"directories":{},"maintainers":[{"name":"ashalfarhan","email":"ashalfarhan8@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hooks_0.2.3_1636181108288_0.7809108464364964"},"_hasShrinkwrap":false}},"time":{"created":"2021-07-11T06:35:38.475Z","0.1.0":"2021-07-11T06:35:38.713Z","modified":"2022-04-04T15:45:17.912Z","0.2.0":"2021-07-15T17:54:23.754Z","0.2.2":"2021-07-15T18:40:22.818Z","0.2.3":"2021-11-06T06:45:08.673Z"},"maintainers":[{"name":"ashalfarhan","email":"ashalfarhan8@gmail.com"}],"description":"> Just a simple React Hooks","homepage":"https://github.com/ashalfarhan/hooks#readme","keywords":["react","react-hooks","hooks","useToggle","use-toggle","useSafeUpdate","use-safe-update","useDebouncedValue","use-debounced-value"],"repository":{"type":"git","url":"git+ssh://git@github.com/ashalfarhan/hooks.git"},"author":{"name":"ashalfarhan"},"bugs":{"url":"https://github.com/ashalfarhan/hooks/issues"},"license":"MIT","readme":"# Minimal React Hooks\n\n> Just a simple React Hooks\n\n## 📦 Installation\n\n---\n\n```bash\nyarn add @ashalfarhan/hooks\n\n#or\n\nnpm install @ashalfarhan/hooks --save\n```\n\n## 🔧 Guide\n\n---\n### 🧲 useToggle\n\n```tsx\nconst { open, onToggle, onOpen, onClose, onSwitch } = useToggle();\n```\n\n- open\n\n  > `boolean`\n  >\n  > Current state of toggle\n  >\n  > Note: Initially false, to change the initial state pass `true` to the `useToggle` parameter\n\n- onToggle\n\n  > `function`\n  >\n  > Function to toggle the state\n\n- onClose\n\n  > `function`\n  >\n  > Function to set the state to `false`\n\n- onOpen\n\n  > `function`\n  >\n  > Function to set the state to `true`\n\n- onSwitch\n\n  > `function`\n  >\n  > Function to set the state to the param that passed in\n\n### 🦺 useSafeUpdate\n\n```tsx\nconst [count, setCount] = useState(0)\nconst safeSetCount = useSafeUpdate(setCount)\n```\n#### Returns\n - safeCallback\n    > `function`\n    > \n    > Function/callback that is safe when you call if your component accidently unmounted.\n\n\n### 🦥 useDebouncedValue\n\n```tsx\nconst [searchQuery, setSearchQuery] = useState(\"\")\nconst debouncedSearchQuery = useDebouncedValue(searchQuery)\n```\n\n#### Returns\n - debouncedValue\n    > `T`\n    >\n    > Value that lazily update based on delay argument, default to `200` (in ms)\n\n### 👈 usePreviousValue\n```tsx\nconst prevCount = usePrevious(count)\n```\n\n### Returns\n - previousValue\n   > `T`\n   >\n   > The prevous value of every render, possibly undefined at first","readmeFilename":"README.md"}