This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-14
Channels
- # aleph (4)
- # announcements (1)
- # beginners (40)
- # calva (6)
- # cider (10)
- # clara (5)
- # cljdoc (24)
- # cljs-dev (2)
- # clojure (24)
- # clojure-italy (4)
- # clojure-uk (5)
- # clojurescript (13)
- # community-development (5)
- # core-async (7)
- # data-science (9)
- # datomic (2)
- # duct (12)
- # emacs (3)
- # events (1)
- # figwheel-main (2)
- # fulcro (2)
- # malli (1)
- # off-topic (1)
- # parinfer (1)
- # precept (6)
- # re-frame (27)
- # shadow-cljs (5)
- # sql (6)
- # unrepl (2)
Is it possible to have a async/chan
that will have a side effect run when it is async/close!
'd?
(regards) Trying to figure out how to implement the following documentation
Returns a channel. If a document exist at `reference`, it will be put! upon
the channel. If no document exist at reference, then `:firemore/no-document` will
be put! on the channel. As the document at reference is updated through
time, the channel will put! the newest value of the document (if it exist)
or :firemore/no-document (if it does not) upon the channel.
Important: close! the channel to clean up the state machine feeding this
channel. Failure to close the channel will result in a memory leak.
Function could instead return a {:chan c, :unregister fx}
to allow for cleanup/closing of channel and state machine, but thought it might be cool to just be able to return a channel and let someone just close!
it when they are done with it...
@samedhi This may be frowned upon, but you could implement a buffer that does the side effect stuff in the buffer's close-buf!
method. then pass that buffer to the channel.