{"id":27383661,"url":"https://github.com/bkjang/use-lazyload","last_synced_at":"2025-04-13T15:45:51.336Z","repository":{"id":57388170,"uuid":"236269969","full_name":"BKJang/use-lazyload","owner":"BKJang","description":"📚This is custom hooks for lazy loading in react.","archived":false,"fork":false,"pushed_at":"2024-04-23T01:55:33.000Z","size":2075,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T18:58:11.681Z","etag":null,"topics":["hooks","intersection-observer","react"],"latest_commit_sha":null,"homepage":"https://bkjang.github.io/use-lazyload","language":"JavaScript","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/BKJang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-26T05:12:35.000Z","updated_at":"2023-06-06T12:38:51.000Z","dependencies_parsed_at":"2022-09-05T05:00:29.569Z","dependency_job_id":null,"html_url":"https://github.com/BKJang/use-lazyload","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/BKJang%2Fuse-lazyload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BKJang%2Fuse-lazyload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BKJang%2Fuse-lazyload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BKJang%2Fuse-lazyload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BKJang","download_url":"https://codeload.github.com/BKJang/use-lazyload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248741115,"owners_count":21154249,"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":["hooks","intersection-observer","react"],"created_at":"2025-04-13T15:45:49.307Z","updated_at":"2025-04-13T15:45:51.330Z","avatar_url":"https://github.com/BKJang.png","language":"JavaScript","readme":"# use-lazyload\n\n\u003e \n\n[![NPM](https://img.shields.io/npm/v/use-lazyload.svg)](https://www.npmjs.com/package/use-lazyload)\n\n## Install\n\n```bash\nnpm install --save use-lazyload\n```\n\n## Usage\n\n```tsx\nimport * as React from 'react';\n\nimport { useLazyload } from 'use-lazyload';\n\nconst options: IObserverOptions = {\n  root: null,\n  rootMargin: \"0px\",\n  thresholds: [0.0],\n};\n\nconst onIntersectCallback = async () =\u003e {\n  //...fetch items\n}\n\nconst Example = () =\u003e {\n  const [element, setElement] = useLazyload(onIntersectCallback, options);\n  return (\n    \u003cdiv\u003e\n      {items.map(\n        //...\n      )}\n      {\n        \u003cdiv ref={setElement}\u003e{isLoading}\u003c/div\u003e\n      }\n    \u003c/div\u003e\n  )\n}\n```\n\n## [Example](https://github.com/BKJang/use-lazyload/tree/master/example)\n\n```bash\ncd example\nnpm install\nnpm run start\n```\n\n## License\n\nMIT © [BKJang](https://github.com/BKJang)\n\n---\n\nThis hook is created using [create-react-hook](https://github.com/hermanya/create-react-hook).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkjang%2Fuse-lazyload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbkjang%2Fuse-lazyload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkjang%2Fuse-lazyload/lists"}