feat: add GroupBy, GroupByUntil and Window/Slice operators - #219
Merged
Merged
Conversation
… LatestOrDefault - SkipWhileNull accepts nullable reference element types without a nullability warning. - LatestOrDefault documents what it emits and when.
- GroupBy and GroupByUntil deliver a keyed GroupedSignal per key. - Window and Slice hand back a signal per window across count, time, boundary, opening and closing forms. - Every signal and witness is public under Advanced.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #219 +/- ##
==========================================
- Coverage 99.80% 99.78% -0.03%
==========================================
Files 757 781 +24
Lines 23650 24558 +908
Branches 2774 2886 +112
==========================================
+ Hits 23605 24504 +899
- Misses 45 54 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
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.



Summary
Adds keyed grouping and windowing operators, and fixes two defects in the extensions package.
GroupByandGroupByUntildeliver a keyedGroupedSignal<TKey, T>per key. They cover the key, element and duration selector forms, and each group completes when its source or its duration signal completes.WindowandSlicehand back a signal per window. They cover count, count with skip, time, time with count, boundary, opening and closing forms.Sliceis the primary name andWindowis the migration alias.Advanced. Each is constructible directly, likeBufferSignal<T>.SkipWhileNullaccepts nullable reference element types. Calling it onIObservable<string?>raises no nullability warning.LatestOrDefaultdocuments what it emits and when.Why
Grouping and windowing are the largest operator families a System.Reactive user looks for and does not find. The
SkipWhileNullconstraint forced a suppression at call sites with nullable element types.Breaking changes
None.
How this was verified
Tests cover every class this adds, using deterministic ordered state checks with a virtual clock for the time-based windows. The
SkipWhileNullchange has a test on a nullable reference source.Notes for the reviewer
GroupedSignal{TKey,T}.csandSliceRouter{TOuter,T}.cs, which the group and window signals share.PublicAPI.txtbaselines, theREADMErows and the per-signal witness files follow one pattern and are safe to skim.Checklist