Skip to content

Add DynamicReactiveView and rename Query API#189

Merged
ChrisPulman merged 2 commits intomainfrom
ExtendFunctionality
Feb 1, 2026
Merged

Add DynamicReactiveView and rename Query API#189
ChrisPulman merged 2 commits intomainfrom
ExtendFunctionality

Conversation

@ChrisPulman
Copy link
Owner

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:

  • 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 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.

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.
@ChrisPulman ChrisPulman merged commit 956767d into main Feb 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant