A re-frame implementation of Dative.
Install Leiningen (plus Java).
Get the Dative source code:
$ git clone https://github.com/dativebase/dative-re-frame.git
Clean build:
$ lein clean $ lein figwheel dev
Run. You'll have to wait for step (3) to do its compile, but then:
$ open http://localhost:3450/
To make the garden ClojureScript auto-compile to CSS:
$ lein garden auto
To compile ClojureScript to JavaScript:
lein clean lein cljsbuild once min
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/cljs/dative
, there's a matching set of files (each small):
src/cljs/dative ├── core.cljs <--- entry point, plus history ├── db.cljs <--- data related (data layer) ├── subs.cljs <--- subscription handlers (query layer) ├── login.cljs <--- reagent components (view layer) ├── old-instances.cljs <--- reagent components (view layer) └── events.cljs <--- event handlers (control/update layer)
- the re-com demo page
- the re-frame README
- the official reagent example