Calls a function repeatedly while a condition returns true and then resolves the promise
by sindresorhusJavaScript
Last 12 weeks ยท 0 commits
4 of 6 standards met
Repository: sindresorhus/p-do-whilst. Description: Calls a function repeatedly while a condition returns true and then resolves the promise Stars: 37, Forks: 5. Primary language: JavaScript. Languages: JavaScript (90.6%), TypeScript (9.4%). License: MIT. Latest release: v2.1.0 (1y ago). Open PRs: 0, open issues: 0. Last activity: 1y ago. Community health: 71%. Top contributors: sindresorhus, gabmontes, BendingBender, Richienb.
Consider supporting the injection of an initial value into the loop. The code could be updated as follows: and that would allow managing the state internally, instead of having to rely in an external variable: Note that this change would be compatible and will not break the current API.