{"_id":"@awesim/useful-react-hooks","_rev":"1-1df736eac00f66c5bd714e4f2d2ba9da","name":"@awesim/useful-react-hooks","dist-tags":{"latest":"1.1.0"},"versions":{"0.1.0":{"version":"0.1.0","license":"MIT","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"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"}},"name":"@awesim/useful-react-hooks","author":{"name":"Asim Sohail"},"module":"dist/use-hooks.esm.js","size-limit":[{"path":"dist/use-hooks.cjs.production.min.js","limit":"10 KB"},{"path":"dist/use-hooks.esm.js","limit":"10 KB"}],"devDependencies":{"@size-limit/preset-small-lib":"^8.2.4","@testing-library/jest-dom":"^5.16.5","@testing-library/react-hooks":"^8.0.1","@types/jest":"^29.5.2","@types/react":"^18.2.8","@types/react-dom":"^18.2.4","husky":"^8.0.3","react":"^18.2.0","react-dom":"^18.2.0","react-test-renderer":"^18.2.0","size-limit":"^8.2.4","tsdx":"^0.14.1","tslib":"^2.5.3","typescript":"^5.1.3"},"repository":{"type":"git","url":"https://github.com/awe-sim/use-hooks"},"description":"Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.","licenseText":"MIT License\n\nCopyright (c) 2023 Asim Sohail\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@awesim/useful-react-hooks@0.1.0","dist":{"shasum":"772d9f7e4589d7d35ca41d0a02533817ae161972","integrity":"sha512-xd/fgmVvNDQWWtCTnciEhfvlmCpphiyPwcu2M3EL4o9E24xBZvZKogA6OIamtxYRaoVSTiK/V1EWFgQHv1zDVw==","tarball":"https://registry.npmjs.org/@awesim/useful-react-hooks/-/useful-react-hooks-0.1.0.tgz","fileCount":17,"unpackedSize":12904,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrD4nDsN0Pw6VSr7rU0U/zFfLANyOFi/2qkAOjF8uVRQIhAMPv5WQ+sP69FTEG/ZMhi3IkovR3Uq317WQs621ySjkl"}]},"_npmUser":{"name":"awesim","email":"awesim@gmail.com"},"directories":{},"maintainers":[{"name":"awesim","email":"awesim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/useful-react-hooks_0.1.0_1685925397905_0.46240195607429246"},"_hasShrinkwrap":false},"1.1.0":{"version":"1.1.0","license":"MIT","name":"@awesim/useful-react-hooks","author":{"name":"Francisco Gomes"},"repository":{"type":"git","url":"https://github.com/awe-sim/useful-react-hooks"},"module":"dist/useful-react-hooks.esm.js","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test --passWithNoTests","lint":"tsdx lint 'src/**/*.{ts,tsx}'","lint:fix":"tsdx lint 'src/**/*.{ts,tsx}' --fix","prepare":"tsdx build","publish-npm":"yarn publish --access public"},"peerDependencies":{"react":">=16"},"husky":{"hooks":{"pre-commit":"tsdx lint 'src/**/*.{ts,tsx}'"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"devDependencies":{"@testing-library/jest-dom":"^5.11.1","@testing-library/react-hooks":"^3.4.1","@types/jest":"^26.0.7","@types/react":"^16.9.43","@types/react-dom":"^16.9.8","husky":"^4.2.5","react":"^16.13.1","react-dom":"^16.13.1","react-test-renderer":"^16.13.1","tsdx":"^0.13.2","tslib":"^2.0.0","typescript":"^3.9.7"},"description":"![Chuck Norris](./src/images/chuck-norris.png)","licenseText":"MIT License\n\nCopyright (c) 2023 Asim Sohail\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@awesim/useful-react-hooks@1.1.0","dist":{"shasum":"4c37eb0e00ecc841b5cb0e0f04d733982f34df68","integrity":"sha512-7tF18750r4UsXv8r29OIu5y6lFed0tcc13NXvMXAPxSsvHKi7TnmI7nIGzB/X0f+A6meFNsu3X0OKfs9st0iJQ==","tarball":"https://registry.npmjs.org/@awesim/useful-react-hooks/-/useful-react-hooks-1.1.0.tgz","fileCount":15,"unpackedSize":6000,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIP8mbRfoCkBhr2WSYZfnsElZjwoZynWdKooG86g6TfQIgNbwKDowJYRI/fbgD4afAZ/S4ILiGImaqLurD+td8xkA="}]},"_npmUser":{"name":"awesim","email":"awesim@gmail.com"},"directories":{},"maintainers":[{"name":"awesim","email":"awesim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/useful-react-hooks_1.1.0_1685932399083_0.9976082396357413"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-05T00:36:37.846Z","0.1.0":"2023-06-05T00:36:38.028Z","modified":"2023-06-05T02:33:19.372Z","1.1.0":"2023-06-05T02:33:19.261Z"},"maintainers":[{"name":"awesim","email":"awesim@gmail.com"}],"description":"![Chuck Norris](./src/images/chuck-norris.png)","repository":{"type":"git","url":"https://github.com/awe-sim/useful-react-hooks"},"author":{"name":"Francisco Gomes"},"license":"MIT","readme":"# useNorris\n\n![Chuck Norris](./src/images/chuck-norris.png)\n\nuseNorris is a [React](http://reactjs.org/) custom Hook that fetches random jokes about our hero Chuck Norris.\n\nIt has been built with [TypeScript](www.typescriptlang.org/), [TSDX](https://github.com/formium/tsdx) and is the support for a training provided by the author.\n\n### NPM\n\nThe package is hosted in the NPM registry and can be found [here](https://www.npmjs.com/package/@franciscomcg/use-norris).\n\n### Install\n\n```bash\nnpm i @franciscomcg/use-norris\n```\n\nor\n\n```bash\nyarn add @franciscomcg/use-norris\n```\n\n### Usage\n\n```typescript\nimport * as React from 'react';\n\nimport useNorris from '@franciscomcg/use-norris';\n\nconst App = () => {\n  const initialState = {\n    response: '',\n    isLoading: false,\n    isError: false,\n    errorMessage: null,\n  };\n  const { response, isLoading, isError, errorMessage } = useNorris(\n    initialState\n  );\n\n  if (errorMessage) {\n    return <p>{errorMessage}</p>;\n  }\n\n  if (isError) {\n    return <p>Something went wrong</p>;\n  }\n\n  if (isLoading) {\n    return <p>Loading...</p>;\n  }\n\n  if (response) {\n    return <p>{response.value}</p>;\n  }\n  return <p>Something went wrong</p>;\n};\n\nexport default App;\n```\n\n### License\n\nMIT © [FranciscoMCG](https://github.com/FranciscoMCG)\n","readmeFilename":"README.md"}