Merge branch 'develop' of https://github.com/Day8/re-frame into develop
This commit is contained in:
commit
c88ad9feb4
|
@ -3,7 +3,8 @@
|
|||
[org.clojure/clojurescript "0.0-2816"]
|
||||
[reagent "0.5.0-alpha3"]
|
||||
[figwheel "0.2.3-SNAPSHOT"]
|
||||
[re-frame "0.2.0"]]
|
||||
[re-frame "0.2.0"]
|
||||
[prismatic/schema "0.3.7"]]
|
||||
|
||||
:plugins [[lein-cljsbuild "1.0.4"]
|
||||
[lein-figwheel "0.2.3-SNAPSHOT"]]
|
||||
|
|
|
@ -1,7 +1,24 @@
|
|||
(ns todomvc.db)
|
||||
(ns todomvc.db
|
||||
(:require
|
||||
[schema.core :as s :include-macros true]))
|
||||
|
||||
|
||||
(def default-initial-state
|
||||
{:todos (sorted-map) ;; todo ids are the keys (for sort)
|
||||
:showing :all ;; one of :all :done or :active
|
||||
})
|
||||
|
||||
|
||||
(def schema
|
||||
{:todos (s/both (s/pred map?) (s/pred sorted?))
|
||||
:showing (s/enum :all :done :active)
|
||||
})
|
||||
|
||||
|
||||
(defn valid-schema?
|
||||
[db]
|
||||
(s/validate schema db))
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue