Skip to content

Commit

Permalink
Adds simple task register / unregister effects
Browse files Browse the repository at this point in the history
  • Loading branch information
jtkDvlp committed Sep 30, 2022
1 parent 9826c4f commit b37c2b6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/jtk_dvlp/re_frame/tasks.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 223,19 @@
(handle-straight-variant context task fxs))))))))


;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Effects

(rf/reg-fx ::register
(fn [name-or-task]
(let [task (normalize-task name-or-task)]
(rf/dispatch-sync [::register task]))))

(rf/reg-fx ::unregister
(fn [task]
(rf/dispatch [::unregister task])))


;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Events

Expand Down

0 comments on commit b37c2b6

Please sign in to comment.