Rename default-value to default-db

This commit is contained in:
Christophe Gragnic 2017-08-07 09:07:39 +02:00 committed by Mike Thompson
parent e9e79eaf08
commit 949a396fb1
2 changed files with 5 additions and 5 deletions

View File

@ -43,9 +43,9 @@
;; 2. `events.cljs` for the registration of :initialise-db handler
;;
(def default-value ;; what gets put into app-db by default.
{:todos (sorted-map) ;; an empty list of todos. Use the (int) :id as the key
:showing :all}) ;; show all todos
(def default-db ;; what gets put into app-db by default.
{:todos (sorted-map) ;; an empty list of todos. Use the (int) :id as the key
:showing :all}) ;; show all todos
;; -- Local Storage ----------------------------------------------------------

View File

@ -1,6 +1,6 @@
(ns todomvc.events
(:require
[todomvc.db :refer [default-value todos->local-store]]
[todomvc.db :refer [default-db todos->local-store]]
[re-frame.core :refer [reg-event-db reg-event-fx inject-cofx path trim-v
after debug]]
[cljs.spec :as s]))
@ -98,7 +98,7 @@
;; the event handler (function) being registered
(fn [{:keys [db local-store-todos]} _] ;; take 2 vals from coeffects. Ignore event vector itself.
{:db (assoc default-value :todos local-store-todos)})) ;; all hail the new state
{:db (assoc default-db :todos local-store-todos)})) ;; all hail the new state
;; usage: (dispatch [:set-showing :active])