{"_id":"@ej-hooks/use-confirm","_rev":"3-619f09cd6dc663f55b2ac71b675dd001","name":"@ej-hooks/use-confirm","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@ej-hooks/use-confirm","version":"1.0.0","description":"React Hook to ask the user for a confirmation before executing a function.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/eunjinfizz/react-hooks.git"},"keywords":["react","hooks","confirm","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-confirm@1.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-MNa8ihDbq0Y4WjsFnm9J+fcEAytzqfGw76ROC5GI+YJqRjawYfQCKTTlILIiNLrZhire/9IDZ6PaFKQWuQwHSA==","shasum":"a0e1622dcac2cec64385cfe690063b417ffd512c","tarball":"https://registry.npmjs.org/@ej-hooks/use-confirm/-/use-confirm-1.0.0.tgz","fileCount":4,"unpackedSize":2393,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhD8AICRA9TVsSAnZWagAA6lgP/jAPLaSzZQku4rx2ZlHW\nJOtogW6tSYPJlprpUAek2/gliPiGmnXbMkZNCGESB22ChzeE602D4da6Mwni\nS1mRowpZ48zoopaGodOpq/+RxEJHmsKj6CiR3k8cyaQGWCNBrmdJ7IoqacYZ\nsD51lOr75K1I2X3BNj/s76u8dlKjU4+9dVM8l49Sm3yBEPTDRjiAG4MWa6/+\ngAR4zKBUuQ1dCHsbKduaZgmzOkzqV3cgTTGg35w4oVsjXAQgLgShSoV1g9yE\nBLQqKLqUspv89GXny9D8l9GvqQKIuam9gtRWpSboEo8ns7AOC+lWOH85a0ad\n9hkvn4OuBbSfRFF9ZaEOCG13m/AS0232sa/qEOuG7Q9B4kBESoz+SBudz/DU\njEBAYI7INtKU3p87aEAY1hai/quk5sClr1TCPpsj+S46Xtwmvk/y7qG3/d+o\n9UwvZ7ssWfXvBpOV0FmyEwN1rqlTVcJ2Ll6MXvDOgeVa++kY6POMSglJwL5J\nvdOspHP18e39luLolYHp+wBvnDh+9hogUxUeuk3873is4z1YjSFfShk2B44X\nA2rmPZDJuBWFIJ3UjbtEz5TbWKXhqACQvexYpQe1kz9b+k2N8N5KnpPzAOFZ\n6i/9QzXLM/K4CQj8KG/kmbQZrjwrt8/rQh0hPSVK8c0i8oACBYzzaA82inx5\nW2Zg\r\n=Y+Eg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIASOGCC9SGDELYD9vQqVgTll/hMMVWL+QcLZUdYUBRPyAiEAh06u8/HSrEFP8Df6HDDvZET940eqwCaQ5xd1ctf8e4Q="}]},"_npmUser":{"name":"eunjinfizz","email":"eunjinfizz@gmail.com"},"directories":{},"maintainers":[{"name":"eunjinfizz","email":"eunjinfizz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-confirm_1.0.0_1628422152770_0.26712885795681673"},"_hasShrinkwrap":false},"1.0.1":{"name":"@ej-hooks/use-confirm","version":"1.0.1","description":"React Hook to ask the user for a confirmation before executing a function.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/eunjinfizz/react-hooks.git"},"keywords":["react","hooks","confirm","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-confirm@1.0.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Sg+7NVPDePWY+/6c0ndiumYU6SqqksiMEd52RKbGvgRvGApZaHdmDgaL1iPfQZquAgDsobBlz3lZ+vx0hJb/wA==","shasum":"105475af911d62063390d44c96d5bef9caa54263","tarball":"https://registry.npmjs.org/@ej-hooks/use-confirm/-/use-confirm-1.0.1.tgz","fileCount":4,"unpackedSize":2404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhPeV/CRA9TVsSAnZWagAAZ/8P/2eFqVam6tY76VjorKsJ\nHlRQG/+OciH/JfvXghlrP592Krmc3jVQJliagNoy3Yt1yh3485ITPlwb9ZX7\ndwwtvhoSihl5NXiqMyFzCkb90AgnyxPs1BtZ2vcqbteVh4HFTdvzv5PW1Usg\n39Q4DrL7J/mZVJJ6R/w6W9gm/2YNJLYMiCrRPsKI6lVyOM7r2R8g+J6pci9v\nj/p7031XIMx3nS3b6I/VmQyAlULhRBi3b7nTY753/zqV7sErEHafZqOmqaZw\nsztsgowjRtWd+AkpiLCJ8QNaWpaCTe9W3gzwaOoJLDxjw/f3ED9vZelrwGsG\namt7SCKiblgS/1pRrHLQ9CiBskbtciRcfz3+uf/hRkT50TrpoDQcLQyv8gUF\nXPKcFvjEq9dut/lUV8vJQ0zkX44jdJEoM0OyG9Cek/OPo0jSvPohVZLVtkKM\nMAIXbn8L41EGhlzh0j29oS+0/WD4VNz1Ry5tS+G2V3qcbkbdm7Y8fpYc5No1\nrj1YcFrjjhLWkfAVJ5z4HEuQFURaQydWyxoEN4fAVxKCCQ54kBALi9z838sT\nRSl5GKxMgWW88t0kX/edebOD+GZoNrI9lwuEiepMx0BBZqvvY+BEyVdQb44W\ncdJGImL1Pjdz+qbU8e1hG5OAvO27IadXocLOaazo4vkKL2jP6dx+v5+SOjgX\nvr/z\r\n=lCTU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqE745C0qfjGAnQAZf/7U2vH/yh5sFhWsHHMRH0x10GQIhAPPmLwFHJAJ8bc6c9U8pQkgKfYOU5hQNTQF+hIjf//eu"}]},"_npmUser":{"name":"eunjinfizz","email":"eunjinfizz@gmail.com"},"directories":{},"maintainers":[{"name":"eunjinfizz","email":"eunjinfizz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-confirm_1.0.1_1631446399461_0.3195983410168819"},"_hasShrinkwrap":false},"1.0.2":{"name":"@ej-hooks/use-confirm","version":"1.0.2","description":"React Hook to ask the user for a confirmation before executing a function.","main":"index.js","repository":{"type":"git","url":"git+https://github.com/eunjinfizz/react-hooks.git"},"keywords":["react","hooks","confirm","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-confirm@1.0.2","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-W+AVyNIU0WnHYecJpxCnmIZHKhl/RwLQ2VjVhII8gtz/WCqW5o0mGnlvkMDf2+jDiYpzwUlnhK1yGBo7mA2YAg==","shasum":"7cf86b588c04c00a810316e61af5968d0c065926","tarball":"https://registry.npmjs.org/@ej-hooks/use-confirm/-/use-confirm-1.0.2.tgz","fileCount":4,"unpackedSize":2468,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhPemdCRA9TVsSAnZWagAAGh0P/057cT8RidnSMr4eTtW/\ncAwn/ksmXzYJ9V8obFNPyDXIIrJOSahiHgpynJglvq6DP0XGA9fBkQbiuHxK\ndbl7Op6ytkROgRdRteOp6i6MRAYWvhNgfE/9C4GDeC3IsNE3klh6HOjI7liu\nL4DVvK0hgh8MDnsWzeQOK66M6ZC7oshqsqSP6Cct0yvMAi9o1UreRSso5D13\nT/FMYjX+YFh8CKyfsNvROmOHkFxbYnPB4DBZEnKhtMeydFEmkczJI9ZGC0SH\nlXR0Dnh8CKT6QwYFd6r87wOrj0enYI6sHQKLdp6s1usWHIn40LHJkiqaOfGo\nHUG2olzAp/CO5CtdxX175uryBW8plxIUUBP/6EN6PhKWVymLS0wwJtNuw0Lw\n1iAe8wTPkSgtrYg5I7eyjD7azrp7HVF6I7NthYMxwwy9VFU+urGzX5BtXCsW\nu0w3L1GBPDguVtHxSBYF3wt3N3roGjaXGWaW51X7MS7PgLEirbuTSVVFm3gz\nBhUmJCTwObTT6LM4v7V3blE+ebZ5Tph4czpL96wmsp13dCPiMnYvejf9zyob\nPavnyMBcMj6lJPzKvdSEGlwDKEpdNg0H0nL+FBLgQRkgOg5HBIQd35FimXyH\nrgMbimQhoog9fzj7LDTcdEGC343alwQfHSIzWDagr+HghwdpAEJoDISBH8rb\nhIkD\r\n=ERBt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCerylU7kXzQGjw3/3u6ReL559adEpy2F0XH8BS9Lb2gQIgV4jesZfcMWIIds1iO+7jn612FM852em8FUMqatH0PAs="}]},"_npmUser":{"name":"eunjinfizz","email":"eunjinfizz@gmail.com"},"directories":{},"maintainers":[{"name":"eunjinfizz","email":"eunjinfizz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-confirm_1.0.2_1631447453653_0.32811662373938577"},"_hasShrinkwrap":false}},"time":{"created":"2021-08-08T11:29:12.701Z","1.0.0":"2021-08-08T11:29:12.906Z","modified":"2022-04-05T07:01:05.251Z","1.0.1":"2021-09-12T11:33:19.619Z","1.0.2":"2021-09-12T11:50:53.804Z"},"maintainers":[{"name":"eunjinfizz","email":"eunjinfizz@gmail.com"}],"description":"React Hook to ask the user for a confirmation before executing a function.","homepage":"https://github.com/eunjinfizz/react-hooks#readme","keywords":["react","hooks","confirm","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-confirm\r\n\r\nReact Hook to ask the user for a confirmation before executing a function.\r\n\r\n## Installation\r\n\r\n#### yarn\r\n\r\n`yarn add @ej-hooks/use-confirm`\r\n\r\n#### npm\r\n\r\n`npm i @ej-hooks/use-confirm`\r\n\r\n## Usage\r\n\r\n```js\r\nimport React from 'react';\r\nimport useConfirm from '@ej-hooks/use-confirm';\r\nfunction App() {\r\n  const deleteWorld = () => console.log('Deleting world...');\r\n  const confirmDelete = useConfirm('Are you sure?', deleteWorld);\r\n  return <button onClick={confirmDelete}>Delete the world</button>;\r\n}\r\n```\r\n\r\n### Arguments\r\n\r\n| Argument  | Type     | Description                                         | Required |\r\n| --------- | -------- | --------------------------------------------------- | -------- |\r\n| message   | string   | Message to show the user on the confirmation propmt | yes      |\r\n| onConfirm | function | Function to be executed when the user confirms      | yes      |\r\n| onCancel  | function | Function to be executed when the user cancels       | no       |\r\n\r\n### Return\r\n\r\n| Return value | Type     | Description                                    | Default value |\r\n| ------------ | -------- | ---------------------------------------------- | ------------- |\r\n| function     | function | Function wrapped around the confirmation logic | null          |\r\n","readmeFilename":"README.md"}