-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Description
Hi, I'm using mount in ClojureScript and I'm having a hard time figuring out how to deal with async code inside a state start.
How does component B that depends on A knows A is ready when A start code is async?
I have something like:
(ns server.db)
(defstate db
:start (let [conn (create-db-connection)]
(create-tables conn (fn []
;; here I know tables are created
))
{:conn conn})
:stop ...)
(ns server.syncer)
(defstate syncer
;; how can I synchronize this so I'm sure
;; this component is started when db component has finished starting
:start (insert-some-stuff-in-db (:conn @server.db))
:stop ...)Thanks!!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels