Skip to content

Can I opt out of state in a zustand storage mapping? #824

Answered by nvie
prideout asked this question in Help
Discussion options

You must be logged in to vote

Hi Philip, unfortunately electing specifically which parts of deep structures to sync as Live structures is currently not possible. The storageMapping is pretty simplistic configuration, which only supports top-level keys, and opting-in is all or nothing.

Possible ways around that are currently:

  1. Structuring your application data differently somehow to avoid the automatic nested LiveList creations. For example, you can consider storing the 3d coordinates in a string encoding (e.g. store [1, 2, 3] as "1,2,3" instead).
  2. Using the lower-level @liveblocks/client to more directly control your storage tree shape.

Perhaps there will be opportunities for us to support this better and more structu…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@prideout
Comment options

@nvie
Comment options

Answer selected by nvie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants