-
Notifications
You must be signed in to change notification settings - Fork 6
feat: subscribeChanges #30
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
Conversation
|
commit: |
c987ff8
to
2ea79ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds a few public APIs:
collection.derivedChanges
is a tanstack/storeDerived
state, it is replaced with the latest changes (insert/update/delete) each time the derived state changes. This can be used inside anEffect
along with other collections to essentially subscribe to a set of charges across the collections. This will be the foundation of the IVM queries.collection.currentStateAsChanges
returns the current state as a set of inserts. It's needed to bootstrap the initial state of a query.collection.subscribeChanges
is a thin wrapper of the above as a higher level public api