{"id":15684181,"url":"https://github.com/patrickjs/request-idle-callback","last_synced_at":"2025-10-16T11:07:15.400Z","repository":{"id":57097750,"uuid":"61440355","full_name":"PatrickJS/request-idle-callback","owner":"PatrickJS","description":"requestIdleCallback for Angular","archived":false,"fork":false,"pushed_at":"2023-10-10T20:18:41.000Z","size":18,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-10-02T06:58:38.713Z","etag":null,"topics":["requestidlecallback","scheduling"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PatrickJS.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":"2016-06-18T15:39:38.000Z","updated_at":"2025-06-07T11:22:50.000Z","dependencies_parsed_at":"2024-06-18T20:27:57.550Z","dependency_job_id":"1c6eb8eb-a9ea-4655-a34b-e9587514b987","html_url":"https://github.com/PatrickJS/request-idle-callback","commit_stats":null,"previous_names":["angularclass/request-idle-callback"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PatrickJS/request-idle-callback","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Frequest-idle-callback","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Frequest-idle-callback/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Frequest-idle-callback/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Frequest-idle-callback/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PatrickJS","download_url":"https://codeload.github.com/PatrickJS/request-idle-callback/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Frequest-idle-callback/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279181898,"owners_count":26121057,"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","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["requestidlecallback","scheduling"],"created_at":"2024-10-03T17:12:26.250Z","updated_at":"2025-10-16T11:07:15.371Z","avatar_url":"https://github.com/PatrickJS.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Angular Request Idle Callback\ncross-platform supported `requestIdleCallback` for Angular used for Progressive Web App and Universal Apps\n\n### Why should I use requestIdleCallback?\nScheduling non-essential work yourself is very difficult to do. It’s impossible to figure out exactly how much frame time remains because after `requestAnimationFrame` callbacks execute there are style calculations, layout, paint, and other browser internals that need to run. A home-rolled solution can’t account for any of those. In order to be sure that a user isn’t interacting in some way you would also need to attach listeners to every kind of interaction event `(scroll, touch, click)`, even if you don’t need them for functionality, just so that you can be absolutely sure that the user isn’t interacting. The browser, on the other hand, knows exactly how much time is available at the end of the frame, and if the user is interacting, and so through `requestIdleCallback` we gain an API that allows us to make use of any spare time in the most efficient way possible.\n\n![](https://developers.google.com/web/updates/images/2015-08-27-using-requestidlecallback/frame.jpg)\n\n## links\n* [Using requestIdleCallback](https://developers.google.com/web/updates/2015/08/using-requestidlecallback)\n* [Cooperative Scheduling of Background Tasks](https://www.w3.org/TR/requestidlecallback/)\n\n\n### Install\n\n\n```typescript\nbootstrap(App, [\n  ...ANGULARCLASS_IDLE_PROVIDERS  \n]);\n```\n\n```typescript\nimport { Idle } from '@angularclass/request-idle-callback';\nclass App {\n  constructor(idle: Idle) {\n\n    idle.requestIdleCallback(() =\u003e {\n      prefetchComponent() // your api\n    });\n\n  }  \n}\n\n```\n\n\nprefetch data/async route after bootstrap via `providePrefetchIdleCallbacks`\n```typescript\nimport { providePrefetchIdleCallbacks } from '@angularclass/request-idle-callback';\n\nfunction callbackToPrefetch() {\n}\n\nvar arrayOfCallbacks = [\n  callbackToPrefetch\n]\n\nbootstrap(App, [\n  providePrefetchIdleCallbacks(arrayOfCallbacks)\n]);\n```\n\n\n___\n\nenjoy — **PatrickJS**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickjs%2Frequest-idle-callback","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickjs%2Frequest-idle-callback","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickjs%2Frequest-idle-callback/lists"}