-
Notifications
You must be signed in to change notification settings - Fork 0
Collection Signals #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
estherbrunner
wants to merge
14
commits into
main
Choose a base branch
from
feature/projection
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
Support optional KeyConfig parameter in createStore to generate stable keys for array items. This allows tracking items across reorders and prevents false change notifications when array structure changes but item identity remains the same.
Replace dual `keyAt` and `indexByKey` Maps with a single `order` array for simpler and more efficient key-to-index tracking. Update `indexByKey` method to `indexOfKey` with consistent return values (-1 for not found). Simplify `current()` to properly handle both array and record stores. Remove unused utility functions `validArrayIndexes` and `recordToArray`.
Documentation and examples for array-like stores with stable keys, which persist through sorting and reordering operations. Includes new store methods `byKey()`, `keyAt()`, `indexOfKey()`, and `splice()`.
Implement Collections in src/collection.ts: - createCollection factory for deriving from stores - Proxy-based array-like interface with computed signals - Key management and event notifications - Read-only enforcement with DuplicateKeyError Rename StoreKeyExistsError to DuplicateKeyError for consistency across both stores and collections. Update system.ts with Notifications and Listener types for standardized event handling across signal types.
lower memory usage at scale [WIP]
implementation Split `List` and `Store` into `BaseList`/`List` and `BaseStore`/`Store` to improve type inference. The base classes contain the implementation, while the type variants provide better structural typing for nested signals and properties. Add utility functions `isNonNullObject` and `isUniformArray` for type guards. Update type definitions to use `UnknownRecord` consistently and remove unnecessary intersection types.
logic of BaseStore and BaseList
transformations. Update documentation to reflect API changes from factory functions to class constructors.
- Add `isAsyncCollectionCallback` helper to properly detect async callbacks - Trigger initial async computations when items are added to collection - Fix proxy to bind methods and properly handle property access - Pass raw additions/removals objects instead of converting to keys - Filter out UNSET values from collection results - Convert `createCollection` from arrow function to named function overloads - Improve `deriveCollection` type signatures with overloads - Update tests to explicitly trigger async computations
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.
No description provided.