{"_id":"@1ohooks/use-escape","_rev":"1-7ccc5894ae02ac22dc11334f74b94111","name":"@1ohooks/use-escape","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@1ohooks/use-escape","version":"0.1.0","main":"dist/packages/useEscape/src/index.js","types":"dist/packages/useEscape/src/index.d.ts","scripts":{"build":"tsc && copyfiles -u 1 src/**/*.{scss,png,jpg} dist/"},"keywords":[],"author":"","license":"ISC","_id":"@1ohooks/use-escape@0.1.0","_nodeVersion":"18.14.2","_npmVersion":"9.5.1","dist":{"integrity":"sha512-6+yVOJhA09cKEPbl4TZ00pDIQ8zuIZvNCELC2as0hp3zWHrJxvP8Q973FSmOgwPi0A1bjsOymorH1uYGyLYWbw==","shasum":"e726d706ae125669d0502e16418bc1118fe8d1ba","tarball":"https://registry.npmjs.org/@1ohooks/use-escape/-/use-escape-0.1.0.tgz","fileCount":7,"unpackedSize":1985,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWxDfdLhF8oPnUhDYv0N9anlSrY4h+NcG+npr/saUd4wIgcr78raedPO0Meg8Xvhkh8Pt7EQVR0x6Os2aRf/7gkJg="}]},"_npmUser":{"name":"1ojames","email":"jameshuntdevelopment@gmail.com"},"directories":{},"maintainers":[{"name":"1ojames","email":"jameshuntdevelopment@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-escape_0.1.0_1695583145206_0.018040249698482835"},"_hasShrinkwrap":false},"0.1.1":{"name":"@1ohooks/use-escape","version":"0.1.1","main":"dist/packages/useEscape/src/index.js","types":"dist/packages/useEscape/src/index.d.ts","scripts":{"build":"tsc && copyfiles -u 1 src/**/*.{scss,png,jpg} dist/"},"keywords":[],"author":"","license":"ISC","description":"`@1ohooks/use-escape` is a custom React hook that simplifies the handling of the Escape key press event. It allows you to execute a callback function when the Escape key is pressed.","_id":"@1ohooks/use-escape@0.1.1","_nodeVersion":"18.14.2","_npmVersion":"9.5.1","dist":{"integrity":"sha512-WB8jtnRVa5CVIfHLG7QM0/dHEt7vjGUym/rjdd4H0r1BuN01Um7YiF/uypMfZMS4V3TkQg6ZPNooaYxhUrs6SA==","shasum":"ffc11a1d20c001a7b81d35db9c3068eb78873f70","tarball":"https://registry.npmjs.org/@1ohooks/use-escape/-/use-escape-0.1.1.tgz","fileCount":8,"unpackedSize":4106,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEh1Z+Rnr8vHrIiZdVX1aI7/E6fT910ieAzYZe6beEg6AiEAmoKwmOdlVeujwLogI0tG1kKQ175DpogIVZPh4xCUbOE="}]},"_npmUser":{"name":"1ojames","email":"jameshuntdevelopment@gmail.com"},"directories":{},"maintainers":[{"name":"1ojames","email":"jameshuntdevelopment@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-escape_0.1.1_1695590667350_0.8978976917808805"},"_hasShrinkwrap":false}},"time":{"created":"2023-09-24T19:19:05.063Z","0.1.0":"2023-09-24T19:19:05.365Z","modified":"2023-09-24T21:24:27.741Z","0.1.1":"2023-09-24T21:24:27.553Z"},"maintainers":[{"name":"1ojames","email":"jameshuntdevelopment@gmail.com"}],"keywords":[],"license":"ISC","readme":"# @1ohooks/use-escape\n\n`@1ohooks/use-escape` is a custom React hook that simplifies the handling of the Escape key press event. It allows you to execute a callback function when the Escape key is pressed.\n\n## Installation\n\nInstall the package with:\n\n```sh\nnpm install @1ohooks/use-escape\n# or\nyarn add @1ohooks/use-escape\n```\n\n## Usage\n\nTo use the `useEscape` hook in your React project, import it and provide a callback function that you want to execute when the Escape key is pressed.\n\n```javascript\nimport { useEscape } from '@1ohooks/use-escape';\n\nfunction MyComponent() {\n  const handleCloseModal = () => {\n    // Implement your logic to close the modal\n  };\n\n  // Attach the useEscape hook with your callback function\n  useEscape(handleCloseModal);\n\n  // The handleCloseModal function will be called when the Escape key is pressed\n\n  return (\n    <div>\n      {/* Your component content */}\n    </div>\n  );\n}\n```\n\n## Example\n\nHere's a simple example of using `@1ohooks/use-escape` to close a modal when the Escape key is pressed:\n\n```javascript\nimport React, { useState } from 'react';\nimport { useEscape } from '@1ohooks/use-escape';\n\nfunction Modal() {\n  const [isOpen, setIsOpen] = useState(true);\n\n  const handleCloseModal = () => {\n    setIsOpen(false);\n  };\n\n  useEscape(handleCloseModal);\n\n  return (\n    <div className={`modal ${isOpen ? 'open' : 'closed'}`}>\n      <div className=\"modal-content\">\n        <h2>Modal Content</h2>\n        <button onClick={handleCloseModal}>Close</button>\n      </div>\n    </div>\n  );\n}\n```\n\n## Contributing\n\nWe welcome contributions from the open-source community to improve and enhance `@1ohooks/use-escape`. If you have ideas for improvements, new features, or bug fixes, please check out our Contributing Guidelines for more information on how to contribute.\n\n## License\n\n`@1ohooks/use-escape` is licensed under the MIT License. You are free to use, modify, and distribute it in your projects. We appreciate attribution but do not require it.\n\nThank you for using `@1ohooks/use-escape` to simplify Escape key handling in your React applications. We hope you find it useful!","readmeFilename":"readme.md","description":"`@1ohooks/use-escape` is a custom React hook that simplifies the handling of the Escape key press event. It allows you to execute a callback function when the Escape key is pressed."}