{"id":28089531,"url":"https://github.com/arifwidianto08/use-lazy-fetch","last_synced_at":"2025-05-13T12:59:39.519Z","repository":{"id":46337325,"uuid":"295505874","full_name":"arifwidianto08/use-lazy-fetch","owner":"arifwidianto08","description":"React utility to perform data fetching , featured with react-hooks too. Created by react-create-library","archived":false,"fork":false,"pushed_at":"2021-10-30T10:06:05.000Z","size":720,"stargazers_count":1,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-05T18:37:06.016Z","etag":null,"topics":["create-react-library","hacktoberfest","hacktoberfest-2021","hacktoberfest2021","javascript","js","react","react-typescript","reactjs","tsx","typescript","utility"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arifwidianto08.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-14T18:35:57.000Z","updated_at":"2024-06-01T16:23:54.000Z","dependencies_parsed_at":"2022-08-29T14:32:16.208Z","dependency_job_id":null,"html_url":"https://github.com/arifwidianto08/use-lazy-fetch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arifwidianto08%2Fuse-lazy-fetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arifwidianto08%2Fuse-lazy-fetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arifwidianto08%2Fuse-lazy-fetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arifwidianto08%2Fuse-lazy-fetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arifwidianto08","download_url":"https://codeload.github.com/arifwidianto08/use-lazy-fetch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253948408,"owners_count":21988953,"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":["create-react-library","hacktoberfest","hacktoberfest-2021","hacktoberfest2021","javascript","js","react","react-typescript","reactjs","tsx","typescript","utility"],"created_at":"2025-05-13T12:59:38.934Z","updated_at":"2025-05-13T12:59:39.501Z","avatar_url":"https://github.com/arifwidianto08.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Owner: Arif Widianto\n\n# use-lazy-fetch\n\n\u003e Performing Data Fetch without initializing state and worrying about useEffect\n\n[![NPM](https://img.shields.io/npm/v/use-lazy-fetch.svg)](https://www.npmjs.com/package/use-lazy-fetch) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n## Install \n\n```bash\nnpm install --save use-lazy-fetch\n```\n\nor using `yarn`\n\n```bash\nyarn add use-lazy-fetch\n```\n\n## Usage \n\n```tsx\nimport React from 'react'\n\nimport { useLazyFetch } from 'use-lazy-fetch'\n\ninterface Todo {\n  data: Array\u003c{\n    userId: number\n    id: number\n    title: string\n    completed: boolean\n  }\u003e\n}\n\nconst App = () =\u003e {\n  const fetchTodos = () =\u003e {\n    return fetch('https://jsonplaceholder.typicode.com/todos')\n      .then((res) =\u003e res.json())\n      .then((val) =\u003e val)\n  }\n  const { query, isLoading } = useLazyFetch()\n  const { data } = query\u003cTodo\u003e(fetchTodos, [], {\n    withEffect: true\n  })\n\n  if (isLoading) {\n    return \u003cdiv\u003e'Loading...'\u003c/div\u003e\n  }\n  return (\n    \u003cdiv\u003e{data \u0026\u0026 data.map((todo) =\u003e \u003cp key={todo.id}\u003e{todo.title}\u003c/p\u003e)}\u003c/div\u003e\n  )\n}\n\nexport default App\n```\n\n## License\n\n## Hacktoberfest\n\nThis line is for hacktoberfest thing\n\nHacktoberfest is the best\n\nMIT © [arifwidianto08](https://github.com/arifwidianto08)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farifwidianto08%2Fuse-lazy-fetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farifwidianto08%2Fuse-lazy-fetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farifwidianto08%2Fuse-lazy-fetch/lists"}