Created
June 27, 2018 04:12
-
-
Save tonysherbondy/b8cfc43e6f61a97126e1b19b0a034419 to your computer and use it in GitHub Desktop.
Show motivating example for reg-obs
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
(db-utils/reg-obs | |
::obs-for-new-smart-boost | |
[[::routes/route] | |
[::working-boost]] | |
(fn [route working-boost] | |
(cond | |
(and (= (:handler route) :manage/content-two-new-smart-boost) | |
(not working-boost)) | |
(rf/dispatch [::set-working-boost {:smart-boost-id (random-uuid) | |
:name "My SmartBoost" | |
:objective "BRAND_AWARENESS" | |
:end-time (.format (moment)) | |
:budget {:type "lifetime" | |
:cents 10000}}]) | |
(and (not= (:handler route) :manage/content-two-new-smart-boost) | |
working-boost) | |
(rf/dispatch [::set-working-boost nil])))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment