Skip to content

Conversation

@estherbrunner
Copy link
Member

No description provided.

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.
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.
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
@estherbrunner estherbrunner changed the title Projection Signals Collection Signals Dec 31, 2025
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.

2 participants