immerjs / immer

Create the next immutable state by mutating the current one

Home Page:https://immerjs.github.io/immer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example of Syncing Immer Patches between Client and Server

BrianHung opened this issue Β· comments

πŸ™‹β€β™‚ Question

Would anyone have an example of how to properly sync immer patches between client and server? Specifically, wondering how to manage patches and snapshots, offline state and possibly a very crude multiplayer?

I've seen some resources before

https://egghead.io/lessons/react-create-a-simple-websocket-server-to-distribute-patches-from-immer
https://github.com/webstudio-is/immerhin

but extending that to more robust realtime sync isn't addressed like in

https://github.com/ProseMirror/prosemirror-collab/blob/master/src/collab.ts
https://github.com/ProseMirror/website/tree/master/src/collab