-
Notifications
You must be signed in to change notification settings - Fork 131
Allow access ShapeStream for electric collections #971
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
base: main
Are you sure you want to change the base?
Allow access ShapeStream for electric collections #971
Conversation
…Stream getter Add shapeStream getter to ElectricCollectionUtils that allows users to access the underlying ShapeStream instance from an electric collection. This enables access to ShapeStream properties like the shape handle. Usage: collection.utils.shapeStream
🦋 Changeset detectedLatest commit: 79bc5ce The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-db-collection
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
|
Size Change: 0 B Total Size: 87.2 kB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 3.35 kB ℹ️ View Unchanged
|
|
This is great, but one thing to note is that the shape stream can change to a new instance during the lifecycle of the collection. We should consider making the collections event emitter extendable so that collections can extend it with new events. Then the electric collection could emit a "shapeStreamChange" event. we likely don't need this to use a Store either. I'm happy to pick up extending the event emitter. |
|
oh interesting – yeah maybe just exposing the raw change events & getters for the shapestream metadata is better yeah than a fragile handle on a shapestream that might get changed |
|
Feel free to pickup! |
Add
shapeStreamgetter to ElectricCollectionUtils that allows users to access the underlying ShapeStream instance from an electric collection. This enables access to ShapeStream properties like the shape handle & offset & subscribing to the raw stream events.