Skip to content

Instantly share code, notes, and snippets.

@n1k0
Last active August 29, 2015 14:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n1k0/08d09ea2f8f491799085 to your computer and use it in GitHub Desktop.
Save n1k0/08d09ea2f8f491799085 to your computer and use it in GitHub Desktop.

Basically Flux

While trying to explain Flux to a friend using words, I realized that a diagram's worth a thousand of them, and went with this.

              +---------------------+               
              |                     |               
              |     Dispatcher      |               
          +-->|          +---------------+
          |   +----------|----------+    |          
register  |              |               |  dispatch
          |              |               |          
   +------+---------+    |     +---------+-----+    
   |                |    |     |               |    
   |     Store      | <--+     |    Actions    |    
   |                |          |               |    
   +------+---------+          +---------------+    
          |                              ^            
  update  |      +----------------+      |  call     
          |      |                |      |            
          +----> |   Component    +------+            
                 |                |                 
                 +----------------+                 

A minimalistic, raw implementation is available as an example on JSbin.

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