Add DynamicReactiveView and rename Query API#189
Merged
ChrisPulman merged 2 commits intomainfrom Feb 1, 2026
Merged
Conversation
Rename QuaternaryList.Query to GetItemsBySecondaryIndex and update usages (tests, benchmarks, README). Introduce DynamicReactiveView and multiple QuaternaryExtensions to support dynamic/filterable reactive views (including CreateView variants and FilterBySecondaryIndex/FilterDynamic). Update IQuaternaryList to expose ICollection<T>, INotifyCollectionChanged and IDisposable, and change Edit to accept Action<ICollection<T>>. Make several internal API/implementation tweaks: QuadList AddRange signature and enumerator type/Dispose adjustments, QuadDictionary.Dispose marked readonly, QuaternaryBase adds event processing / INCC adapter stubs. Add DynamicSearchTests and update existing tests to use the new API. Update README to document unsupported index-based operations and new API names, and add demo/test app view files. These changes clarify index semantics, enable dynamic reactive views, and keep implementations consistent with the new APIs.
Introduce explicit batch actions and secondary-index matching across the quaternary collection stack. Summary of changes: - Add CacheAction.BatchAdded and CacheAction.BatchRemoved and update tests to expect 7 enum values. - ReactiveView and DynamicReactiveView now handle BatchAdded and BatchRemoved notifications (remove/add items from view accordingly). - QuaternaryList: emit BatchAdded for AddRange and new helpers to emit batch-removed events (EmitBatchRemoved, EmitBatchRemovedFromList). Add ItemMatchesSecondaryIndex<TKey> for runtime secondary-index key comparisons and use MatchesKey on indices. - ISecondaryIndex: add MatchesKey(T item, object key) contract; SecondaryIndex<T,TKey> implements MatchesKey using the selector and EqualityComparer. - QuaternaryExtensions: take array snapshots (ToArray) for thread-safety, change secondary-index view creation to use ItemMatchesSecondaryIndex so filtering is dynamic, simplify and optimize key-based lookups (LINQ usage and HashSet for keys), and adjust observable-based filters to use SelectMany and HashSet. - Tests: add new QuaternaryExtensionsTests and update QuaternaryListTests (migrate to NET8, switch FluentAssertions to xUnit Assert, adjust expectations for new batch actions and behaviors). - AddressBookViewModel: use fluent disposables, replace some ToList()/ToArray() usage, use RemoveKeys for bulk dictionary sync, dispose adjustments, and chain ToProperty with DisposeWith. These changes make batch operations explicit (added vs removed), improve secondary-index filtering correctness and performance, and update tests and sample code to align with the new behaviors.
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.
Rename QuaternaryList.Query to GetItemsBySecondaryIndex and update usages (tests, benchmarks, README).
Introduce DynamicReactiveView and multiple QuaternaryExtensions to support dynamic/filterable reactive views (including CreateView variants and FilterBySecondaryIndex/FilterDynamic).
Update IQuaternaryList to expose ICollection, INotifyCollectionChanged and IDisposable, and change Edit to accept Action<ICollection>.
Make several internal API/implementation tweaks: QuadList AddRange signature and enumerator type/Dispose adjustments, QuadDictionary.Dispose marked readonly, QuaternaryBase adds event processing / INCC adapter stubs.
Add DynamicSearchTests and update existing tests to use the new API.
Update README to document unsupported index-based operations and new API names, and add demo/test app view files.
These changes clarify index semantics, enable dynamic reactive views, and keep implementations consistent with the new APIs.
Introduce explicit batch actions and secondary-index matching across the quaternary collection stack.
Summary of changes:
These changes make batch operations explicit (added vs removed), improve secondary-index filtering correctness and performance, and update tests and sample code to align with the new behaviors.