{"id":16495704,"url":"https://github.com/nainemom/use-shit","last_synced_at":"2025-03-23T13:31:35.099Z","repository":{"id":239801326,"uuid":"800617444","full_name":"nainemom/use-shit","owner":"nainemom","description":"The best use-hook ever made.","archived":false,"fork":false,"pushed_at":"2024-05-14T21:27:50.000Z","size":44,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T20:47:01.778Z","etag":null,"topics":["fun","hooks-api-react","react","use-hook","vue3"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nainemom.png","metadata":{"files":{"readme":"Readme.md","changelog":"CHANGELOG.md","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":"2024-05-14T17:10:32.000Z","updated_at":"2024-10-26T13:23:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a958d60-fbb7-4f7d-a246-cecc9a8fb633","html_url":"https://github.com/nainemom/use-shit","commit_stats":null,"previous_names":["nainemom/use-shit"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nainemom%2Fuse-shit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nainemom%2Fuse-shit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nainemom%2Fuse-shit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nainemom%2Fuse-shit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nainemom","download_url":"https://codeload.github.com/nainemom/use-shit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245108178,"owners_count":20562000,"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":["fun","hooks-api-react","react","use-hook","vue3"],"created_at":"2024-10-11T14:32:15.121Z","updated_at":"2025-03-23T13:31:35.075Z","avatar_url":"https://github.com/nainemom.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# use-shit\n\n![NPM License](https://img.shields.io/npm/l/use-shit)\n![npm bundle size](https://img.shields.io/bundlephobia/minzip/use-shit)\n\n\u003e The best use-hook ever made.\n\n## Installation:\n\n```bash\nnpm i use-shit\n```\n## Usage\n```ts\nimport { useShit } from 'use-shit';\n\nconst REAL_SHIT = [1, 2, 3, 4];\n\nconst [shit] = useShit(REAL_SHIT); // shit === REAL_SHIT\n```\n## Example 1\n```tsx\nimport { useShit } from 'use-shit';\n\nconst REAL_SHIT = [1, 2, 3, 4];\n\nfunction Component() {\n  - const shit = REAL_SHIT; // ❌ It's ugly\n  + const [shit] = useShit(REAL_SHIT); // ✅ Nice and smooth\n\n  return (\n    \u003c\u003e\n      \u003cp\u003eThanks god, My code is beautiful!\u003c/p\u003e\n      \u003cul\u003e\n        { shit.map((slice) =\u003e (\n          \u003cli key={slice}\u003e{slice}\u003c/li\u003e\n        )) }\n      \u003c/ul\u003e\n    \u003c/\u003e\n  );\n}\n```\n\n## Example 2\n```tsx\nimport { useShit } from 'use-shit';\n\nfunction Component() {\n  const [num1, setNum1] = useState(0);\n  const [num2, setNum2] = useState(0);\n\n  - const sum = num1 + num2; // ❌ It doesn't look good\n  - const sum = useMemo(() =\u003e num1 + num2, [num1, num2]); // ❌ Unnessesury use of cache\n  + const [sum] = useShit(num1 + num2); // ✅ Nice and feels right\n\n  return (\n    \u003c\u003e\n      \u003cinput type=\"number\" onChange={(e) =\u003e setNum1(e.target.valueAsNumber)} /\u003e\n      \u003cinput type=\"number\" onChange={(e) =\u003e setNum2(e.target.valueAsNumber)} /\u003e\n      \u003cb\u003e{sum}\u003c/b\u003e\n    \u003c/\u003e\n  );\n}\n```\n\n## License\n\n[MIT](./LICENSE)\n\n---\n\n![Static Badge](https://img.shields.io/badge/don't-use_shit-green)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnainemom%2Fuse-shit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnainemom%2Fuse-shit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnainemom%2Fuse-shit/lists"}