{"id":13657890,"url":"https://github.com/jamestomasino/scroll-frame","last_synced_at":"2026-02-06T17:37:44.132Z","repository":{"id":44627976,"uuid":"455215330","full_name":"jamestomasino/scroll-frame","owner":"jamestomasino","description":"Better scroll event management using requestAnimationFrame.","archived":false,"fork":false,"pushed_at":"2022-03-18T18:58:20.000Z","size":456,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-12T18:21:00.791Z","etag":null,"topics":["npm","requestanimationframe","scroll"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@jamestomasino/scroll-frame","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamestomasino.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}},"created_at":"2022-02-03T15:18:45.000Z","updated_at":"2022-02-12T14:16:03.000Z","dependencies_parsed_at":"2022-08-24T05:40:43.142Z","dependency_job_id":null,"html_url":"https://github.com/jamestomasino/scroll-frame","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/jamestomasino/scroll-frame","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamestomasino%2Fscroll-frame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamestomasino%2Fscroll-frame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamestomasino%2Fscroll-frame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamestomasino%2Fscroll-frame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamestomasino","download_url":"https://codeload.github.com/jamestomasino/scroll-frame/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamestomasino%2Fscroll-frame/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29170349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T16:33:35.550Z","status":"ssl_error","status_checked_at":"2026-02-06T16:33:30.716Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["npm","requestanimationframe","scroll"],"created_at":"2024-08-02T05:00:52.776Z","updated_at":"2026-02-06T17:37:44.093Z","avatar_url":"https://github.com/jamestomasino.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Scroll Frame [![Node.js Package](https://github.com/jamestomasino/scroll-frame/actions/workflows/npm-publish.yml/badge.svg?branch=main)](https://github.com/jamestomasino/scroll-frame/actions/workflows/npm-publish.yml)\n\nBetter scroll event management using requestAnimationFrame.\n\n## Overview\n\n`scroll-frame` sets up one master requestAnimationFrame loop which processes callbacks only when the browser window is scrolling. Any deviation in page `window.pageYOffset` or `window.pageXOffset` will trigger the callbacks to fire. When the window stops scrolling the callbacks stop firing. Multiple callbacks can be added to this scroll listener behavior. Callbacks can also be removed from the listener.\n\n## Install\n\n```bash\nnpm install @jamestomasino/scroll-frame\n```\n\n## Use\n\n```js\n/**\n * Binds a callback function to the scroll listener\n *\n * @param {function} func The callback function to trigger on scroll\n * @param {boolean} breakOnError If callback function throws an error, remove from scroll listener\n */\nfunction addScrollListener(func, breakOnError = false)\n\n/**\n * Remove a callback function from the scroll listener\n *\n * @param {function} func The callback function to remove from the scroll listener\n */\nfunction removeScrollListener(func)\n```\n\n## Example\n```js\nconst { addScrollListener, removeScrollListener } = require('@jamestomasino/scroll-frame');\n\nfunction onMove() {\n  console.log('moving')\n}\n\naddScrollListener(onMove) // onMove will be called upon scroll.\nremoveScrollListener(onMove) // onMove will no longer be called upon scroll\n```\n\n## License\n\n[AGPL-3.0 or later](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamestomasino%2Fscroll-frame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamestomasino%2Fscroll-frame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamestomasino%2Fscroll-frame/lists"}