Skip to content
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

A way to filter out "self-inflicted" changes #1058

Open
aboodman opened this issue Jun 25, 2024 · 0 comments
Open

A way to filter out "self-inflicted" changes #1058

aboodman opened this issue Jun 25, 2024 · 0 comments
Labels
Future Something we want to fix but is not blocking next release

Comments

@aboodman
Copy link
Contributor

Many text editors and canvases that people want to hook Replicache to maintain their own internal state, and they don't have a way to run in "controlled" mode. tldraw is one example of this.

As such, people really want to be able to hear events from tldraw, apply them to Replicache, and then have Replicache sync those changes. Unfortunately Replicache wants to be the source of truth, so it fires a subscription/watch, which the user then replays on tldraw (luckily tldraw considers it a no-op at this point and the madness stops).

To get this to work properly, it seems like there could be a way to write a mutation but specifically opt out of hearing about its changes.

I think the right way to do this would be to apply the mutation and then take the new client view after the mutation is applied as the client's base state. That way any changes from rebase will be detected properly.

@aboodman aboodman added the Future Something we want to fix but is not blocking next release label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Future Something we want to fix but is not blocking next release
Projects
None yet
Development

No branches or pull requests

1 participant