{"_id":"@am-hooks/use-beforeunload","_rev":"1-c448336786a3f77a65b5ccc129ddc03b","name":"@am-hooks/use-beforeunload","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@am-hooks/use-beforeunload","version":"1.0.0","description":"A notification is displayed if the user wants to leave the page without saving the changes.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/dorothy7964/am-hooks.git"},"keywords":["beforeunload"],"author":{"name":"wooami"},"license":"MIT","bugs":{"url":"https://github.com/dorothy7964/am-hooks/issues"},"homepage":"https://github.com/dorothy7964/am-hooks#readme","_id":"@am-hooks/use-beforeunload@1.0.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-q6ufAYjE+vITVnof45RDB+e203KYmM00PKNGpazPkZzuvgSPNv6Km+bXGElfwLK2MvomFh9oIyoRpzHc6ar7Qw==","shasum":"d6783af9a5c735b7b0ed42e8c0239e7e62fa46c4","tarball":"https://registry.npmjs.org/@am-hooks/use-beforeunload/-/use-beforeunload-1.0.0.tgz","fileCount":4,"unpackedSize":1675,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZ/GdCRA9TVsSAnZWagAAVhgP/1RFIe/MoGQ1cNQqxnCO\n1nYvPIeDkZvZ4+hYj3FLqatdwBG+AwjJC/T5kFZPPY9Njm3vBiB1WdHgNQJU\ngxly3GlpfHYXSLFjAnOY1XdldPF1GYblwGAYEUKRCfljMvhk69eEPmacgYdF\nZf9O83Kb6A0XZ1vJvRZ4SafZwDb3qMnbD/m3xyyP4149wbuJHHLrQohm1L8r\nLI9Ny6lHcqP/9ombnVdPWeVzKemqphwvIi5MLK6MH/NPEJHxUDOw/mLtXazA\nq0znGt0yZuNqNp8cyqWs/xLqhdRVQT87N1q8gkB9HBZbasfE9bFcHFNXus2O\nIavR3Olz5ksMCRr+GLxzxXdiuC0rUH5/BZAAdxWozU6DRq00SZLwFUuxpk4q\nQ7IXfoxNbKk5jyYwvUy38OS1opr+/HiedhwUM+lFDo28oxiF9/+sMfkOZRhp\nPXwZrlctStI/k9l9+b0aPs6EZvWdSVl9K2JqI/WevpjHG+nwRH6Hul4lrbBA\nHwxFUcXsIznYPMk67/EagyLS+mGvlwZoLAF3cDA7f5V/29smnz8dqpe0en3+\nY1ll4Gc4+r7eohzeiLI7gCrvRe1BdrAkBRyAyXB1+QQ3NuebuzzNzZGd3ys7\nVxkYVF32iGM7qyiAd0vNGe5B+LE4uQBR101rAG8lyvaP/5LQ9aU1ID8rZPot\ni47O\r\n=FOo9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHNRUn8yZ7DGnWV7R5qPur8g/lEn0VjIk0zQDC7fvJ7fAiBzhY+VfPGjkKXZ48Fy2hg5pyZ3+QFamwIrbqB/gGW8kw=="}]},"maintainers":[{"name":"wam-6577","email":"wam6577@gmail.com"}],"_npmUser":{"name":"wam-6577","email":"wam6577@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-beforeunload_1.0.0_1583870365042_0.7841087910082454"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-10T19:59:24.806Z","1.0.0":"2020-03-10T19:59:25.353Z","modified":"2022-04-04T13:42:27.980Z"},"maintainers":[{"name":"wam-6577","email":"wam6577@gmail.com"}],"description":"A notification is displayed if the user wants to leave the page without saving the changes.","homepage":"https://github.com/dorothy7964/am-hooks#readme","keywords":["beforeunload"],"repository":{"type":"git","url":"git+https://github.com/dorothy7964/am-hooks.git"},"author":{"name":"wooami"},"bugs":{"url":"https://github.com/dorothy7964/am-hooks/issues"},"license":"MIT","readme":"# usePreventLeave\r\n유저가 변경 사항을 저장하지 않고 페이지를 벗어나가길 원할 때 알림 메시지 표시<br><br>\r\n\r\n## Installation\r\n\r\n#### yarn\r\n\r\n`yarn add @am-hooks/use-preventLeave`\r\n\r\n#### npm\r\n\r\n`npm i @am-hooks/use-preventLeave` <br><br>\r\n\r\n## Usage\r\n\r\n```js\r\nimport usePreventLeave from \"@am-hooks/use-preventLeave\";\r\n\r\nconst App = () => {\r\n  const { enablePrevent, disablePrevent } = usePreventLeave();\r\n  \r\n  return (\r\n    <>\r\n      <button onClick={enablePrevent}>protect</button>\r\n      <button onClick={disablePrevent}>unprotect</button> \r\n    </>\r\n  )\r\n}\r\n```\r\n\r\n<br><br>\r\n","readmeFilename":"README.md"}