{"id":17242879,"url":"https://github.com/imcuttle/interval-check","last_synced_at":"2025-03-26T03:44:38.441Z","repository":{"id":45113200,"uuid":"291670191","full_name":"imcuttle/interval-check","owner":"imcuttle","description":"Polling check by intervally","archived":false,"fork":false,"pushed_at":"2022-01-07T14:16:10.000Z","size":106,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T02:34:01.924Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imcuttle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-08-31T09:19:49.000Z","updated_at":"2020-09-01T01:48:24.000Z","dependencies_parsed_at":"2022-08-31T05:10:24.389Z","dependency_job_id":null,"html_url":"https://github.com/imcuttle/interval-check","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Finterval-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Finterval-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Finterval-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imcuttle%2Finterval-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imcuttle","download_url":"https://codeload.github.com/imcuttle/interval-check/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245585798,"owners_count":20639671,"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":[],"created_at":"2024-10-15T06:14:19.159Z","updated_at":"2025-03-26T03:44:38.418Z","avatar_url":"https://github.com/imcuttle.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# interval-check\n\n[![Build status](https://img.shields.io/travis/imcuttle/interval-check/master.svg?style=flat-square)](https://travis-ci.org/imcuttle/interval-check)\n[![Test coverage](https://img.shields.io/codecov/c/github/imcuttle/interval-check.svg?style=flat-square)](https://codecov.io/github/imcuttle/interval-check?branch=master)\n[![NPM version](https://img.shields.io/npm/v/interval-check.svg?style=flat-square)](https://www.npmjs.com/package/interval-check)\n[![NPM Downloads](https://img.shields.io/npm/dm/interval-check.svg?style=flat-square\u0026maxAge=43200)](https://www.npmjs.com/package/interval-check)\n[![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://prettier.io/)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat-square)](https://conventionalcommits.org)\n\n\u003e Polling check by intervally\n\n## Installation\n\n```bash\nnpm install interval-check\n# or use yarn\nyarn add interval-check\n```\n\n## API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n### setIntervalCheck\n\n#### Parameters\n\n- `fn` {Function}\n- `shouldStop` {() =\u003e boolean | Promise\u003cboolean\u003e}\n- `interval` {number}\n\n#### Examples\n\n```javascript\nimport setIntervalCheck from 'interval-check'\n\nlet data\nfetch('/data').then((res) =\u003e {\n  data = res\n})\n\nconst dispose = setIntervalCheck(\n  () =\u003e {\n    console.log('fetching /data')\n  },\n  () =\u003e !!data,\n  1000\n)\n```\n\nReturns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)**\n\n## Contributing\n\n- Fork it!\n- Create your new branch:  \n  `git checkout -b feature-new` or `git checkout -b fix-which-bug`\n- Start your magic work now\n- Make sure npm test passes\n- Commit your changes:  \n  `git commit -am 'feat: some description (close #123)'` or `git commit -am 'fix: some description (fix #123)'`\n- Push to the branch: `git push`\n- Submit a pull request :)\n\n## Authors\n\nThis library is written and maintained by imcuttle, \u003ca href=\"mailto:moyuyc95@gmail.com\"\u003emoyuyc95@gmail.com\u003c/a\u003e.\n\n## License\n\nMIT - [imcuttle](https://github.com/imcuttle) 🐟\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Finterval-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimcuttle%2Finterval-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimcuttle%2Finterval-check/lists"}