{"id":23577093,"url":"https://github.com/boostup/react-custom-hooks-collection","last_synced_at":"2025-05-16T15:35:30.951Z","repository":{"id":143735857,"uuid":"287920718","full_name":"boostup/react-custom-hooks-collection","owner":"boostup","description":"NPM package for collecting React custom hooks","archived":false,"fork":false,"pushed_at":"2020-10-12T08:23:34.000Z","size":2557,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T08:40:24.765Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boostup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-16T10:23:05.000Z","updated_at":"2020-10-13T11:29:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"1f3e546d-385e-4d79-ace2-f49fb4386294","html_url":"https://github.com/boostup/react-custom-hooks-collection","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boostup%2Freact-custom-hooks-collection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boostup%2Freact-custom-hooks-collection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boostup%2Freact-custom-hooks-collection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boostup%2Freact-custom-hooks-collection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boostup","download_url":"https://codeload.github.com/boostup/react-custom-hooks-collection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254556761,"owners_count":22090993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-26T22:19:28.646Z","updated_at":"2025-05-16T15:35:30.945Z","avatar_url":"https://github.com/boostup.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM](https://img.shields.io/npm/v/@boostup/react-custom-hooks-collection.svg)](https://www.npmjs.com/package/@boostup/react-custom-hooks-collection) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n# It is all in the name of the package baby !\n\n[Live Demo](https://boostup.github.io/react-custom-hooks-collection/)\n\n## Install\n\n```bash\nnpm i @boostup/react-custom-hooks-collection\n```\n\n## `useToggle` Example\n\n```jsx\nimport React from 'react'\nimport { useToggle } from '@boostup/react-custom-hooks-collection'\n\nfunction App() {\n  const [isHappy, setIsHappy] = useToggle(true)\n\n  return (\n    \u003cdiv\u003e\n      \u003ch2\u003euseToggle Demo\u003c/h2\u003e\n      \u003ch1 onClick={setIsHappy}\u003e{isHappy ? '😀' : '😡'}\u003c/h1\u003e\n    \u003c/div\u003e\n  )\n}\n\nexport default App\n```\n## Notes\n\n- All demos are available inside the `/example/src/demoComponents` directory \n- All custom hooks are available inside the `/src/hooks` directory\n\n---\n\n## Other React hook resources\n\n- [Home-baked Hooks](https://react.christmas/2019/13)\n\n- [streamich/react-use: React Hooks — 👍](https://github.com/streamich/react-use)\n\n- [gragland/usehooks: Easy to understand React Hook code recipes](https://github.com/gragland/usehooks#post-index)\n\n- [react-hook-form - npm](https://www.npmjs.com/package/react-hook-form)\n\n### Videos to learn about hooks\n\n- [90% Cleaner React With Hooks](https://www.youtube.com/watch?v=wXLf18DsV-I)\n\n---\n\n## About this NPM package\n\nThis package was generated thanks to the [create-react-library package](https://www.npmjs.com/package/create-react-library#creating-a-new-module).\n\n---\n\n## Contributing to this package\n\n- [create-react-library documentation](https://www.npmjs.com/package/create-react-library#development)\n- to start the dev environment, simply run the command: \n```\nnpm run dev\n``` \n\n### Local development consists of two parts :\n\n1) Rollup watches the `/src/` directory (where the custom hooks are collected) for any changes in the code and automatically recompiles it into the `/dist/` directory\n\n2) The `/example/` directory is a `create-react-app` app that serves the puropose of demonstrating the use of each of the custom `hooks` collected in `/src/hooks`.  \n\nAnytime changes are made in `/src/` or `/example/src`, they will be live-reloaded, allowing for real-time development of this NPM package.\n\n---\n\n## Dev Troubleshooting\n\nIf you use VS Code on linux, you might get the following error after running the `npm run dev` command: \n\n\u003e Visual Studio Code is unable to watch for file changes in this large workspace (error ENOSPC)\n\nThis would show as a nice little snackbar popup. [So, here goes the solution](https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc), but copying it below just in case this link disappears:\n\n\u003e When you see this notification, it indicates that the VS Code file watcher is running out of handles because the workspace is large and contains many files. The current limit can be viewed by running:\n\n```bash\ncat /proc/sys/fs/inotify/max_user_watches\n```\n\n\u003e The limit can be increased to its maximum by editing /etc/sysctl.conf and adding this line to the end of the file:\n\n```bash\nfs.inotify.max_user_watches=524288\n```\n\n\u003e The new value can then be loaded in by running sudo sysctl -p. Note that Arch Linux works a little differently, See Increasing the amount of inotify watchers for details.\n\u003e While 524,288 is the maximum number of files that can be watched, if you're in an environment that is particularly memory constrained, you may wish to lower the number. Each file watch takes up 1080 bytes, so assuming that all 524,288 watches are consumed, that results in an upper bound of around 540 MiB.\n\u003e Another option is to exclude specific workspace directories from the VS Code file watcher with the files.watcherExclude setting. The default for files.watcherExclude excludes node_modules and some folders under .git, but you can add other directories that you don't want VS Code to track.```\n\n```json\n\"files.watcherExclude\": {\n    \"**/.git/objects/**\": true,\n    \"**/.git/subtree-cache/**\": true,\n    \"**/node_modules/*/**\": true\n  }\n```\n\n## [License](https://github.com/boostup/react-custom-hooks-collection/blob/master/LICENSE)\n\nGNUv3 © [boostup](https://github.com/boostup)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboostup%2Freact-custom-hooks-collection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboostup%2Freact-custom-hooks-collection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboostup%2Freact-custom-hooks-collection/lists"}