re-frame/examples/todomvc
Rob Jentzema be6c53131d newlines and eof newline 2016-04-11 11:31:29 +12:00
..
devsrc/todomvc Changes: 2015-05-12 13:17:31 +10:00
resources/public Updated TodoMvc css to newest version. Fixes some issues with #94 2015-08-12 18:18:20 -06:00
src/todomvc newlines and eof newline 2016-04-11 11:31:29 +12:00
.gitignore Switch to using CircleCI and automated testing with Karma 2015-12-10 21:47:18 +13:00
README.md Bump to version 0.4.1 2015-05-28 23:17:40 +10:00
project.clj Time to release v0.7.0 2016-03-14 23:32:54 +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. Clean build

    lein do clean, figwheel
    
  5. Run You'll have to wait for step 4 to do its compile, but then:

    open http://localhost:3450
    

Compile an optimized version

  1. Compile

    lein do clean, with-profile prod compile
    
  2. Open the following in your browser

    resources/public/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.