2015-03-03 13:15:56 +11:00
|
|
|
# TodoMVC done with re-frame
|
2015-02-26 14:51:59 +13:00
|
|
|
|
2015-03-05 00:45:33 +11:00
|
|
|
A re-frame implementation of [TodoMVC](http://todomvc.com/).
|
2015-02-26 14:51:59 +13:00
|
|
|
|
|
|
|
|
2015-03-03 13:15:56 +11:00
|
|
|
## Setup And Run
|
|
|
|
|
2015-03-05 00:45:33 +11:00
|
|
|
1. Install Lien
|
2015-03-03 13:15:56 +11:00
|
|
|
|
|
|
|
1. Get the re-frame repo
|
|
|
|
```
|
|
|
|
git clone https://github.com/Day8/re-frame.git
|
|
|
|
```
|
|
|
|
|
2015-03-05 00:45:33 +11:00
|
|
|
1. go to the right example directory
|
2015-03-03 13:15:56 +11:00
|
|
|
```
|
|
|
|
cd re-frame/examples/todomvc
|
|
|
|
```
|
|
|
|
|
2015-03-05 00:45:33 +11:00
|
|
|
1. build
|
2015-03-03 13:15:56 +11:00
|
|
|
```
|
|
|
|
lein cljsbuild once
|
|
|
|
```
|
|
|
|
|
2015-03-05 00:45:33 +11:00
|
|
|
1. run
|
2015-03-03 13:15:56 +11:00
|
|
|
```
|
|
|
|
open todo.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)
|
|
|
|
```
|
|
|
|
|
2015-03-05 00:45:33 +11:00
|
|
|
Each part has its own cljs namespace.
|
2015-03-03 13:15:56 +11:00
|
|
|
|
|
|
|
|
|
|
|
## Notes
|
|
|
|
|
2015-03-05 00:45:33 +11:00
|
|
|
This is a modified version of the [the offical reagent example](https://github.com/reagent-project/reagent/tree/master/examples/todomvc)
|
2015-03-03 13:15:56 +11:00
|
|
|
|