Skip to content

Commit

Permalink
Feature: Group by Dynamic Selector Function (#849)
Browse files Browse the repository at this point in the history
Addresses #848 by providing new overloads for the `Group` operator that allow the user to supply a `IObservable<Func<TObject, TKey, TGroupKey>>` so that the function that is used to obtain the GroupKey can change dynamically.  When a new value is supplied, a new GroupKey will be obtained for each item, and if the GroupKey has changed, the item will be moved to the new Group.

Also allows for an optional `IObservable<Unit>` parameter that will force the current GroupKey selector to be re-applied to all the items.
  • Loading branch information
dwcullop committed Feb 14, 2024
1 parent 3fd9ed9 commit 9b09d9c
Show file tree
Hide file tree
Showing 12 changed files with 750 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,14 @@ namespace DynamicData
where TObject : notnull
where TKey : notnull
where TGroupKey : notnull { }
public static System.IObservable<DynamicData.IGroupChangeSet<TObject, TKey, TGroupKey>> Group<TObject, TKey, TGroupKey>(this System.IObservable<DynamicData.IChangeSet<TObject, TKey>> source, System.IObservable<System.Func<TObject, TGroupKey>> groupSelectorKeyObservable, System.IObservable<System.Reactive.Unit>? regrouper = null)
where TObject : notnull
where TKey : notnull
where TGroupKey : notnull { }
public static System.IObservable<DynamicData.IGroupChangeSet<TObject, TKey, TGroupKey>> Group<TObject, TKey, TGroupKey>(this System.IObservable<DynamicData.IChangeSet<TObject, TKey>> source, System.IObservable<System.Func<TObject, TKey, TGroupKey>> groupSelectorKeyObservable, System.IObservable<System.Reactive.Unit>? regrouper = null)
where TObject : notnull
where TKey : notnull
where TGroupKey : notnull { }
public static System.IObservable<DynamicData.IGroupChangeSet<TObject, TKey, TGroupKey>> GroupOnObservable<TObject, TKey, TGroupKey>(this System.IObservable<DynamicData.IChangeSet<TObject, TKey>> source, System.Func<TObject, System.IObservable<TGroupKey>> groupObservableSelector)
where TObject : notnull
where TKey : notnull
Expand Down

0 comments on commit 9b09d9c

Please sign in to comment.