mirror of
https://github.com/status-im/re-frame.git
synced 2025-02-23 15:28:09 +00:00
Add missing handler to "Loading Initial Data" doc
"The pattern" implies `:initialise-db` handler, but it is missing. This PR adds a very simple implementation.
This commit is contained in:
parent
005f76c0a6
commit
1e2c6703f5
@ -136,6 +136,11 @@ quick sketch of the entire pattern. It is very straight-forward.
|
||||
(fn [db _]
|
||||
(not (empty? db)))) ;; do we have data
|
||||
|
||||
(re-frame/reg-event-db
|
||||
:initialise-db
|
||||
(fn [db _]
|
||||
(assoc db :display-name "Jane Doe")))
|
||||
|
||||
(defn main-panel ;; the top level of our app
|
||||
[]
|
||||
(let [name (re-frame/subscribe :name)] ;; we need there to be good data
|
||||
|
Loading…
x
Reference in New Issue
Block a user