{"_id":"@ej-hooks/use-before-leave","_rev":"1-b3ac6047f66858cc71252d07f9699698","name":"@ej-hooks/use-before-leave","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@ej-hooks/use-before-leave","version":"1.0.0","description":"React Hook to execute a function when the mouse leaves the page. Useful to show a popup or for analytics.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/eunjinfizz/react-hooks.git"},"keywords":["react","hooks","before-leave","react-hooks"],"author":{"name":"Eunjin Kwon","email":"eunjinfizz@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/eunjinfizz/react-hooks/issues"},"homepage":"https://github.com/eunjinfizz/react-hooks#readme","peerDependencies":{"react":"^17.0.2","react-dom":"^17.0.2"},"_id":"@ej-hooks/use-before-leave@1.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-978JHIs6mf01vSVmQBjkgOw7ZFnK1Vdu8LqtglCgRoSilk9rDaUFqzq/a4v/XvKg29CzeNsB6z0c6mqJ2MY6KA==","shasum":"40e4666439c03bbb922bf1c9280ecf1c7d08839f","tarball":"https://registry.npmjs.org/@ej-hooks/use-before-leave/-/use-before-leave-1.0.0.tgz","fileCount":4,"unpackedSize":2027,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhD9LBCRA9TVsSAnZWagAA+8cP/0IyBttjiH9a1sRw1Q3Q\nNzNfW3URZShNz5DF6K6x0VkxWprNYjJRifWWnly2uj+X31MK0uo+/NUjcArk\nbXu8Ub9DgvmOv6tGssAB8RCp4d+OX8WK9YAW1X/r+N9FxXgfgaKJxGHMq/hT\nhzDRJkrKtrRRtA61nyWgEd3PTsENAIEWVcKxwySRU7RJSjC7pNzF79N5FZS2\nBZ7RkPjDDZ6yAAbpeM76hx7h7OTr3zd9G2Pb9mNBWEss4bjUGTEBbT4qMRaI\nbzxQfmAfXXF6JYUTSWR4wS7yc/ah3loGyTkOVqr12brade9Ko7OGF7nzTK/o\nUvVk63n/5TdsUP4h4OHejKBinn6RMKpF0uLj6V8VuL7sFkgtkVG1HX9rinQi\nyZXgIG+ukOvMitU5mcUq/XV8bpRCfzy27LTXarXomoWijiPvnYxdd6P1W1nh\nclA6p46yDw5QXgaty8qK+Ep942n2kT4u7YxnLcQKFF05PmoiG9fbRXVnxIcZ\ncvf+ESaHZu80WGpu1wWPKXhRtsF71oF3BFtPkqkvBLjsMLl0dxmCm9t43//p\nHandLMU4JnQrgO/UlnK6rO1IvAZmUXizYdWxB1OoxU3szlIDxNIvw00DWwJA\nnTMjwE0H+NF5Zv6w4E1kY4zFBQDuttpb5mAeXP/m0Zsl2gE0o4QsycUYV7Vy\nT37f\r\n=wcFH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNANZBmvo0n6NWbV6E8oAOf7kX33/AC+UT58EgAEOFwwIgej5bSSnqQScvK0olpzlhj91R3XCviIwuxVHjDRxmerQ="}]},"_npmUser":{"name":"eunjinfizz","email":"eunjinfizz@gmail.com"},"directories":{},"maintainers":[{"name":"eunjinfizz","email":"eunjinfizz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-before-leave_1.0.0_1628426945014_0.21496588800856808"},"_hasShrinkwrap":false}},"time":{"created":"2021-08-08T12:49:04.954Z","1.0.0":"2021-08-08T12:49:05.153Z","modified":"2022-04-05T07:01:04.670Z"},"maintainers":[{"name":"eunjinfizz","email":"eunjinfizz@gmail.com"}],"description":"React Hook to execute a function when the mouse leaves the page. Useful to show a popup or for analytics.","homepage":"https://github.com/eunjinfizz/react-hooks#readme","keywords":["react","hooks","before-leave","react-hooks"],"repository":{"type":"git","url":"git+https://github.com/eunjinfizz/react-hooks.git"},"author":{"name":"Eunjin Kwon","email":"eunjinfizz@gmail.com"},"bugs":{"url":"https://github.com/eunjinfizz/react-hooks/issues"},"license":"MIT","readme":"# @ej-hooks/use-before-leave\r\n\r\nReact Hook to execute a function when the mouse leaves the page. Useful to show a popup or for analytics.\r\n\r\n## Installation\r\n\r\n#### yarn\r\n\r\n`yarn add @ej-hooks/use-before-leave`\r\n\r\n#### npm\r\n\r\n`npm i @ej-hooks/use-before-leave`\r\n\r\n## Usage\r\n\r\n```js\r\nimport React from 'react';\r\nimport useBeforeLeave from '@ej-hooks/use-before-leave';\r\nfunction App() {\r\n  const beforeLeave = () => console.log('User is leaving...');\r\n  useBeforeLeave(beforeLeave);\r\n  return <h1>Hello Nooks</h1>;\r\n}\r\n```\r\n\r\n### Arguments\r\n\r\n| Argument      | Type     | Description                                              | Required |\r\n| ------------- | -------- | -------------------------------------------------------- | -------- |\r\n| onBeforeLeave | function | Function to be called when the mouse leaves the document | yes      |\r\n","readmeFilename":"README.md"}