@repeaterjs/repeater
3.1.0 · 8 Jun 2026MIT15M / weekRepositoryHomepagenpmAtom feed
Upgrading @repeaterjs/repeater From 2.0.0 to 3.0.0
1 release in betweenevery note read
Reading releases, release notes and advisories…
- ?
- changes to make
- 0
- advisories fixed
- 0
- new
- 0
- fixes
8 other lines we could not sort, mostly version bumps
- 3.0.0
Previously, the n-th call to
pushresolved to the value passed to the n-th call toRepeater.prototype.next. This was inaccurate insofar as async generators resume the n-thyieldwith the value passed to the n+1-th call tonext. Additionally, async generators completely ignore the first value passed tonextentirely. The former behavior of repeaters was confusing insofar as the first call topushwould always resolve immediately, becausepushcould not be called untilnextwas called for the first time. In 3.0, the behavior has now been changed so that the n-th call topushresolves to the n+1-th call tonext. - 3.0.0
Calling
Repeater.prototype.throwwill now cause the previouspushcall to reject, rather than simply stopping the repeater and throwing the error. This means errors thrown into repeaters are now recoverable. If you call push without awaiting or callingthen/catchon the returned promise and then call thethrowmethod, the repeater will rethrow the error, preserving the previous behavior. However, if you awaitpushor otherwise call thethenorcatchmethods, it becomes your responsibility to handle errors thrown in viathrowand stop the repeater. #43 - 3.0.0
The
stoppromise no longer resolves to the value passed toRepeater.prototype.return. Instead, it consistently fulfills toundefinedwhen the repeater is stopped. Additionally, callingRepeater.prototype.returnwill return a result whose value is always whatever was passed toreturn. In the case of premature returns, the return value of the executor is ignored unless it throws an error. #41 - 3.0.0
Errors thrown by the executor now take priority over rejections passed to push. If a pushed promise rejects, the repeater will await the execution result and throw an error thrown by the executor instead of the rejected promise.
- 3.0.0
Changes to combinator methods
- 3.0.0
Repeater,RepeaterExecutor,Pushand other related types now take the type parametersTReturnandTNextin line with typescript 3.6’s strict async generator typings. - 3.0.0
The
RepeaterBufferinterface and concrete classes no longer accept a type parameter. All places where the type parameter would have been used,unknownis used instead. You should never directly add or remove values from buffers. - 3.0.0
The typings of the
nextandreturnmethods have been changed to acceptPromiseLike<T>andPromiseLike<TReturn>respectively as parameters.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.