{"id":21875386,"url":"https://github.com/func-star/mor-scroll-watcher","last_synced_at":"2026-05-16T18:31:23.401Z","repository":{"id":57302818,"uuid":"145825876","full_name":"func-star/mor-scroll-watcher","owner":"func-star","description":"Mona系列 - React滚动监听器","archived":false,"fork":false,"pushed_at":"2018-08-27T05:24:51.000Z","size":316,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-22T10:16:13.388Z","etag":null,"topics":["events","mona","monajs","scroll-watcher"],"latest_commit_sha":null,"homepage":"https://func-star.github.io/mor-scroll-watcher/","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/func-star.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":"2018-08-23T08:40:38.000Z","updated_at":"2018-10-09T11:27:01.000Z","dependencies_parsed_at":"2022-09-20T17:43:51.934Z","dependency_job_id":null,"html_url":"https://github.com/func-star/mor-scroll-watcher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/func-star/mor-scroll-watcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/func-star%2Fmor-scroll-watcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/func-star%2Fmor-scroll-watcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/func-star%2Fmor-scroll-watcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/func-star%2Fmor-scroll-watcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/func-star","download_url":"https://codeload.github.com/func-star/mor-scroll-watcher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/func-star%2Fmor-scroll-watcher/sbom","scorecard":{"id":413749,"data":{"date":"2025-08-11","repo":{"name":"github.com/func-star/mor-scroll-watcher","commit":"e9838dc091a08683b932ff3e4111a8b372fac8b0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T23:18:19.722Z","repository_id":57302818,"created_at":"2025-08-18T23:18:19.722Z","updated_at":"2025-08-18T23:18:19.722Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33114145,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"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":["events","mona","monajs","scroll-watcher"],"created_at":"2024-11-28T07:15:36.411Z","updated_at":"2026-05-16T18:31:23.385Z","avatar_url":"https://github.com/func-star.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mona系列 - React滚动监听组件\n\n✨✨ 这是一款非常有用轻巧的 React 组件，你可以应用到任何需要滚动监听的场景\n\n[![npm](https://img.shields.io/npm/v/mor-scroll-watcher.svg?style=flat-square)](https://www.npmjs.com/package/mor-scroll-watcher) [![npm](https://img.shields.io/npm/dt/mor-scroll-watcher.svg?style=flat-square)](https://www.npmjs.com/package/mor-scroll-watcher)\n\n[demo页面](https://func-star.github.io/mor-scroll-watcher/)\n\n## 使用场景\n\n- 滚动曝光埋点\n- 图片懒加载\n- 视图区域按需加载\n\n...\n\n\n## 依赖\n\n- [mona-events](https://www.npmjs.com/package/mona-events)\n\n\n## 使用指南\n```js\nimport Watcher from 'mor-scroll-watcher'\nconst WatcherItem = Watcher.item\n\nWatcher.init(options)\n\u003cWatcherItem ...\u003e\n\t...\n\u003c/WatcherItem\u003e\n```\n\n\u003e 你只需要将需要被滚动触发的节点设置为`WatcherItem`节点的`children`，就能达到滚动触发的目的。\n\n\n## 代码演示\n```js\nimport React, { Component } from 'react'\nimport Watcher from 'mor-scroll-watcher'\n\nconst WatcherItem = Watcher.item\n\nexport default class Home extends Component {\n\tcomponentDidMount () {\n\t\tnew Watcher({\n\t\t\twrap: findDOMNode(this.refs.views)\n\t\t\t// bottomEmit: 100,\n\t\t\t// initEmit: false\n\t\t})\n\t}\n\n\tonWatcher (index) {\n\t\t// do something\n\t\tconsole.log(index)\n\t}\n\n\trender () {\n\t\tconst list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]\n\t\treturn (\n\t\t\t\u003cdiv className=\"wrap\" ref=\"views\"\u003e\n\t\t\t\t\u003cFor of={list} each=\"item\" index=\"index\"\u003e\n\t\t\t\t\t\u003cWatcherItem\n\t\t\t\t\t\tclassName=\"w-full scroller-item\"\n\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\theight: '200px',\n\t\t\t\t\t\t\tbackground: 'yellow',\n\t\t\t\t\t\t\tmargin: '20px 0'\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonWatcher={this.onWatcher.bind(this, index)}\n\t\t\t\t\t\u003e\n\t\t\t\t\t\t{item}\n\t\t\t\t\t\u003c/WatcherItem\u003e\n\t\t\t\t\u003c/For\u003e\n\t\t\t\u003c/div\u003e\n\t\t)\n\t}\n}\n\n```\n\n## 高阶用法\n\n当页面内存在多个需要被监听滚动的容器时，需要设置唯一ID\n\n```js\nimport React, { Component } from 'react'\nimport Watcher from 'mor-scroll-watcher'\n\nconst WatcherItem = Watcher.item\n\nexport default class Home extends Component {\n\tcomponentDidMount () {\n\t\tnew Watcher({\n\t\t\twrap: findDOMNode(this.refs.views)\n\t\t\tmonaId: 'weiyiID_123456'\n\t\t\t// bottomEmit: 100,\n\t\t\t// initEmit: false\n\t\t})\n\t}\n\n\tonWatcher (index) {\n\t\t// do something\n\t\tconsole.log(index)\n\t}\n\n\trender () {\n\t\tconst list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]\n\t\treturn (\n\t\t\t\u003cdiv className=\"wrap\" ref=\"views\"\u003e\n\t\t\t\t\u003cFor of={list} each=\"item\" index=\"index\"\u003e\n\t\t\t\t\t\u003cWatcherItem\n\t\t\t\t\t\tmonaId: 'weiyiID_123456'\n\t\t\t\t\t\tclassName=\"w-full scroller-item\"\n\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\theight: '200px',\n\t\t\t\t\t\t\tbackground: 'yellow',\n\t\t\t\t\t\t\tmargin: '20px 0'\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonWatcher={this.onWatcher.bind(this, index)}\n\t\t\t\t\t\u003e\n\t\t\t\t\t\t{item}\n\t\t\t\t\t\u003c/WatcherItem\u003e\n\t\t\t\t\u003c/For\u003e\n\t\t\t\u003c/div\u003e\n\t\t)\n\t}\n}\n\n```\n\n## options\n\n| 参数 | 说明 | 类型 | 默认值 | 是否必传 |\n| --- | --- | --- | --- | :-- |\n| wrap | 滚动容器 | `DOM原生节点` | - | `yes` |\n| monaId | 当页面内存在多个需要监听的容器时，需要设置唯一的id，并与被监听的`WatcherItem`的属性`monaId`保持统一 | `String` | - | - |\n| bottomEmit | 滚动距离底部的触发距离 | `Number` | `0` | `no` |\n| initEmit | 初始化是否需要触发一次 | `Boolean` | `true` | `no` |\n\n## WatcherItem\n\n| 参数 | 说明 | 类型 | 默认值 | 可选项 |\n| --- | --- | --- | --- | :-- |\n| onWatcher | 触发之后的回调 | `Function` | - | - |\n| monaId | 当页面内存在多个需要监听的容器时，需要设置唯一的id，并与初始化的实例的属性`monaId`保持统一 | `String` | - | - |\n| className | className属性 | `String` | - | - |\n\n\n## 联系我\n\n\u003e 微信：599321378\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunc-star%2Fmor-scroll-watcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunc-star%2Fmor-scroll-watcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunc-star%2Fmor-scroll-watcher/lists"}