mirror of
https://github.com/status-im/re-frame.git
synced 2025-02-22 14:58:12 +00:00
Rename default-value to default-db
This commit is contained in:
parent
e9e79eaf08
commit
949a396fb1
@ -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 ----------------------------------------------------------
|
||||
|
@ -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])
|
||||
|
Loading…
x
Reference in New Issue
Block a user