{"id":15434012,"url":"https://github.com/sebinsua/then-while","last_synced_at":"2025-06-13T16:04:35.967Z","repository":{"id":143142266,"uuid":"85609042","full_name":"sebinsua/then-while","owner":"sebinsua","description":"Call an (a)sync function until an (a)sync predicate returns false.","archived":false,"fork":false,"pushed_at":"2017-03-21T14:25:46.000Z","size":45,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-07T09:04:45.685Z","etag":null,"topics":["async","predicate","promise","sync","then","while"],"latest_commit_sha":null,"homepage":null,"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/sebinsua.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2017-03-20T17:58:35.000Z","updated_at":"2017-03-22T19:46:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"51b67e40-52a9-4d1c-8553-95c7461927d5","html_url":"https://github.com/sebinsua/then-while","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/sebinsua%2Fthen-while","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebinsua%2Fthen-while/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebinsua%2Fthen-while/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebinsua%2Fthen-while/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebinsua","download_url":"https://codeload.github.com/sebinsua/then-while/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240682069,"owners_count":19840437,"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":["async","predicate","promise","sync","then","while"],"created_at":"2024-10-01T18:36:43.153Z","updated_at":"2025-02-25T14:24:47.954Z","avatar_url":"https://github.com/sebinsua.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `then-while`\n\u003e Call an (a)sync function until an (a)sync predicate returns false.\n\nBy default the behaviour is that of a [do while loop](https://en.wikipedia.org/wiki/Do_while_loop).\n\n## Example\n\n```js\nconst createThenWhile = require('then-while')\n\nconst predicate = value =\u003e Promise.resolve(value \u003c 0.5)\nconst performStep = message =\u003e Promise.resolve(`${(Math.random())}`)\n\nconst generateNumber = createThenWhile(predicate, performStep)\n\ngenerateNumber('some arguments')\n  .then(randomNumber =\u003e console.log('random number:', randomNumber))\n```\n\n## Install\n\n```sh\nyarn add then-while\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebinsua%2Fthen-while","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebinsua%2Fthen-while","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebinsua%2Fthen-while/lists"}