re-frame/examples/todomvc
mike-thompson-day8 f08067c68f Merge branch 'master' into develop 2015-04-17 23:51:53 +10:00
..
src/todomvc Merge branch 'master' into develop 2015-04-17 23:51:53 +10:00
README.md And we're there. TodoMVC working. 2015-03-07 00:39:09 +11:00
index.html And we're there. TodoMVC working. 2015-03-07 00:39:09 +11:00
project.clj Now I really am working on v0.4.0 2015-04-17 23:49:31 +10:00
todos.css Use the latest todomvc CSS 2015-03-03 13:16:10 +11:00

README.md

TodoMVC done with re-frame

A re-frame implementation of TodoMVC.

Setup And Run

  1. Install Leiningen (plus Java).

  2. Get the re-frame repo

    git clone https://github.com/Day8/re-frame.git
    
  3. cd to the right example directory

    cd re-frame/examples/todomvc
    
  4. build

    lein cljsbuild once
    
  5. run

    open index.html
    

Exploring The Code

From the re-frame readme:

To build a re-frame app, you:
  - design your app's data structure (data layer)
  - write and register subscription functions (query layer)
  - write Reagent component functions (view layer)
  - write and register event handler functions (control layer and/or state transition layer)

In src, there's a matching set of files (each small):

src
├── core.cljs         <--- entry point, plus history
├── db.cljs           <--- data related  (data layer)
├── subs.cljs         <--- subscription handlers  (query layer)
├── views.cljs        <--- reagent  components (view layer)
└── handlers.cljs     <--- event handlers (control/update layer)

Notes

Various:

  • The offical reagent example.
  • There's also a sibling example (under construction) called TodoMVC-plus which is a more complete example, including testing etc.
  • Look at the re-frame Wiki.