feat(throttle): propose future duration signals - #7642
Draft
hansschenker wants to merge 1 commit into
Draft
hansschenker wants to merge 1 commit into
hansschenker wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal
This draft adds an opt-in future-duration contract for audit-mode
throttlein RxJS 9:Motivation
ObservableValueproves that a value can be converted to an Observable; it does not prove when that Observable will notify. A synchronous Observable or Iterable can therefore close an audit window in the selector's call stack and make a synchronous burst behave like pass-through rather than rate-limiting.Design
FutureDurationSignaland thefutureDuration(...)factoryauditConfig, which selects a strictthrottleoverloadObservableValueinputs to a microtaskThrottleConfigand its full structural input boundary unchangedthrottleSymbol rather than adding a separate audit operatorThe guarantee is intentionally narrow: a branded duration cannot notify in the selector's current synchronous call stack. It does not promise eventual notification or an elapsed-time lower bound, and completion without a value keeps the existing non-emitting cleanup behavior.
Compatibility and migration
This is recorded as proposed D-060. The RxJS 7 migration adapter is deliberately unchanged: wrapping an existing immediate or empty duration is a semantic change, so automated adoption still needs an explicit policy decision.
JavaScript behavior and manually written generic throttle configurations remain compatible. The stricter contract applies only when callers opt into the exported
auditConfigvalue.Verification
git diff --check