Last 12 weeks · 0 commits
4 of 6 standards met
What Adds comprehensive JSDoc documentation to the delay module. Why Improves developer experience by providing clear documentation for the API surface. JSDoc comments help IDEs provide autocomplete and make the codebase more maintainable. How Added module-level @module documentation Added JSDoc to createDelay function with @param descriptions Added JSDoc to default delay function with @param, @returns, and @example Added JSDoc to rangeDelay function with @param descriptions Added JSDoc to clearDelay function with @param description Testing All 9 existing tests pass ✅
The default implementation of setTimeout can only accept values within the range of positive signed 32-bit integers. Passing a timeout greater than (2^31)-1 milliseconds (0x7FFFFFFF) yields a TimeoutOverflowWarning and causes the runtime to ignore the specified timeout, assuming a value of 1ms (which by the way seems a dangerous default, I would have opted for using the maximum supported value or straight out throw an error). This unexpected behavior is not documented in the README, but rather than documenting this quirk of the runtime I'd like to propose a solution: instead of relying on the bare setTimeout, could use a wrapped version of it. Something like this: The timeoutContext is passed by reference, therefore each time gets called the timeout id gets updated, so that can always access the most recent value.
Repository: sindresorhus/delay. Description: Delay a promise a specified amount of time Stars: 624, Forks: 38. Primary language: JavaScript. Languages: JavaScript (84.5%), TypeScript (15.5%). License: MIT. Latest release: v7.0.0 (8mo ago). Open PRs: 0, open issues: 0. Last activity: 8mo ago. Community health: 85%. Top contributors: sindresorhus, SamVerschueren, jamestalmage, ariporad, felixfbecker, novemberborn, Richienb, timdp, olsonpm, Torgen and others.