Skip to content

Latest commit

 

History

History
77 lines (49 loc) · 2.39 KB

README.rst

File metadata and controls

77 lines (49 loc) · 2.39 KB

Dative in re-frame

A re-frame implementation of Dative.

Setup and run

  1. Install Leiningen (plus Java).

  2. Get the Dative source code:

    $ git clone https://github.com/dativebase/dative-re-frame.git
    
  3. Clean build:

    $ lein clean
    $ lein figwheel dev
    
  4. Run. You'll have to wait for step (3) to do its compile, but then:

    $ open http://localhost:3450/
    
  5. To make the garden ClojureScript auto-compile to CSS:

    $ lein garden auto
    

Production Build

To compile ClojureScript to JavaScript:

lein clean
lein cljsbuild once min

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/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)

Useful documents