unscriptable / ds-json-patch-todos

Demo of Differential Sync using JSON Patch over WebSocket

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Differential Sync using JSON Patch

This is a simple demo Todos app that uses Differential Sync and JSON Patch over WebSocket to synchronize data between the server and any number of connected clients, in near-real-time.

Try it

  1. npm install
  2. bower install
  3. npm start
  4. Open http://localhost:8080 in a browser window
  5. Add/remove/edit/etc some todos
  6. Open http://localhost:8080 in a second browser window
  7. Add/remove/edit/etc some todos
  8. Open http://localhost:8080 in a third browser window
  9. Add/remove/edit/etc some todos
  10. ...
  11. Be sure to try the shiny, candy-like button. It does a bunch of things in one "transaction", ie in a single websocket message:
    1. Doubles the number of todos
    2. Completes every 3rd todo
    3. Appends "!!!!" to every 5th todo
    4. Removes every other todo

You can use Chrome's network tab to watch the websocket frames, and the server will log patching events to the console.

About

Demo of Differential Sync using JSON Patch over WebSocket


Languages

Language:JavaScript 78.8%Language:CSS 21.2%