Syncing stores using socket streams
summary
Claim: a dispatcher that emits Flux actions over sockets keeps stores in sync across clients while remaining a drop-in replacement for the Facebook dispatcher. Implementation uses socket.io, adds a default broadcast flag to dispatch so actions either propagate or stay local, and prevents network echo by intercepting between dispatch and callback. Proven with a chat demo and a canvas multiplayer demo that update optimistically, and server-side logging to elastic search enables real-time analytics.
AI-written summary · about
chapters (10)
- 0:00Start
- 1:57maintaining consistency gets cumbersome
- 2:28flux to the rescue!
- 3:58one-way data flow
- 4:18trigger(eventName, data)
- 5:56dispatcher looks promising
- 8:26demo
- 8:52over-the-network loop
- 12:41other work Elle Rotengerg - Flux over the wire
- 13:21the possibilities are endless
related talks
26mFlux over the Wire
31mFlux: Utilize unidirectional data flow ...
31mApplying Unidirectional Data Flow Beyond the ReactJS Ecosystem
45mBeyond REST: Using Full-Stack Signals for Real-Time Reactive UIs
23msocket.io
28mWriting better multi-process hybrid apps with React and Redux
25mA cartoon guide to the wilds of data handling in React
25mFlux Architecture with Xamarin
