You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We're using ReactFlow with Liveblocks. ReactFlow is a graphing library. We store our nodes and edges (arrays) for the graph visualization in Zustand. We want all collaborators in our product to share the same view of the graph, so our nodes and edges are set to true in the storageMapping property of the liveblocks wrapper around our Zustand state.
However, in certain cases, we do not want to synchronize parts of the nodes and edges. For example, let's say there's a className attribute in a node:
[{ id: "1234", className: "foo" }]
If we were to supply a className value for dark mode when the user switches their theme, it would replicate the same className to other collaborators connected to the room.
Therefore, I'd only like to synchronize a partial of the object, in this case the id:
[{ id: "1234" }]
even though my zustand state should remain having both fields.
Describe the solution you'd like
I'd love the ability to specify a function that dictates filtering and merging logic that can be used outbound and inbound (respectively) so I can keep my zustand state the same while specifying how liveblocks should deal with state synchronization.
Something like this, but this is pretty clearly only supporting the filtering case:
Is your feature request related to a problem? Please describe.
We're using ReactFlow with Liveblocks. ReactFlow is a graphing library. We store our nodes and edges (arrays) for the graph visualization in Zustand. We want all collaborators in our product to share the same view of the graph, so our nodes and edges are set to
true
in thestorageMapping
property of the liveblocks wrapper around our Zustand state.However, in certain cases, we do not want to synchronize parts of the nodes and edges. For example, let's say there's a className attribute in a node:
[{ id: "1234", className: "foo" }]
If we were to supply a
className
value for dark mode when the user switches their theme, it would replicate the same className to other collaborators connected to the room.Therefore, I'd only like to synchronize a partial of the object, in this case the id:
[{ id: "1234" }]
even though my zustand state should remain having both fields.
Describe the solution you'd like
I'd love the ability to specify a function that dictates filtering and merging logic that can be used outbound and inbound (respectively) so I can keep my zustand state the same while specifying how liveblocks should deal with state synchronization.
Something like this, but this is pretty clearly only supporting the filtering case:
The text was updated successfully, but these errors were encountered: