Skip to content

Instantly share code, notes, and snippets.

@rektide
Last active August 29, 2015 14:11
Show Gist options
  • Save rektide/862fda7ab3a1c343880b to your computer and use it in GitHub Desktop.
Save rektide/862fda7ab3a1c343880b to your computer and use it in GitHub Desktop.
Principles & Practices downstream of Unidirectional-Data-Flow

Unidirectional Data-Flow is an implementation design. Views map store's state (edge triggered) into a view. The view creates actions. Actions update the store. This fufills:

  1. Functional Reactive Programming (#FRP): the view is a function over the stores, and is called as the stores update, producing DOM output.
  2. Command-Query Responsibility Separation (#CQRS): actions are commands changing the centralized states, the view is a query on the state.
  3. Event-Sourcing (#ES): actions are themselves transmitted states asserted into a dispatcher, which can maintain the log, thereby enabling an undo-redo. In practice, often the retained log is the list of states instead of list of events (as bijectional events are hard to get right), but it enables ES's chief win: programmatic access to the sequence of computation.

This is the first time I'd say web-dev is anywhere close to getting it right. Everything else has been an experiment, until now: this is the first total-ordering I've seen for how web-development can be done that is consistent, adaptable, and not rote based: it's imminently principled over practiced, and the principle of it could stand alone and last 100 years. The virtual-dom work makes implementation possible.

https://plus.google.com/u/0/113218107235105855584/posts/5eFTLpqDyDP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment