Last active
February 28, 2018 18:51
-
-
Save dimovich/12c0ec251c5cffc48d1d6cccfa4fa555 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(re-frame/reg-event-db | |
:db/initialize-iota | |
(fn [db [_ v]] | |
(let [state (make-state)] | |
(assoc db :state state)))) | |
(re-frame/reg-event-fx | |
:db/initialize-iota-mam | |
(fn [{{:keys [state] :as db} :db} _] | |
{:db db | |
:dispatch [:db/change-state state]}) | |
(re-frame/reg-event-fx | |
:db/change-state | |
(fn [{db :db} [_ state]] | |
(let [new-state (change-state state)] | |
{:db (assoc db :state new-state) | |
:db/stateful-fn state}))) | |
(re-frame/reg-fx | |
:db/stateful-fn | |
(fn [state] | |
...)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment