This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # admin-announcements (19)
- # announcements (1)
- # beginners (14)
- # boot (244)
- # cider (2)
- # clojure (23)
- # clojure-dev (23)
- # clojure-poland (55)
- # clojure-russia (118)
- # clojure-uk (4)
- # clojurescript (143)
- # core-async (31)
- # core-logic (1)
- # cursive (30)
- # datascript (2)
- # datomic (3)
- # emacs (7)
- # hoplon (40)
- # ldnclj (8)
- # off-topic (2)
- # om (64)
- # reagent (10)
- # ring (1)
- # yada (71)
is there a way to put individual results of
map (vs the entire seq) into the channel returned by
swizzard: no, the usual way to do this is to create a dedicated
out channel and have the
go block put its values into that, and ignore the value actually put on
go’s return value channel.
Example: I have an Outfit (collection of maps representing clothing items). Each item must be updated asynchronously, and only once all updates are complete, do something with the "updated" Outfit
If so, you can just
async/merge their resulting channels into a single channel. If you need to block until all of the merged channels’ values have been delivered on the merged channel, you can use
async/into. Of course, you can do a lot of this manually using
once I have the height and width of the image, i'm trying to put it to one channel per item
It looks like you create a new Image object, but then it just gets garbage collected. Unless I’m misunderstanding something?
I see. I’m not a DOM guru, didn’t know that was possible. You’re sure it isn’t being GC’d? Does your
onload callback get executed?
yeah. Before I added the
a/into it was printing out the first value of the result of
ok, thanks for looking. If I can come up with a good next question, i'll follow up
That implies that not all of the
merged channels are being closed (because until they are, the channel returned from
merge doesn’t close, and until that closes,
into doesn’t return a channel.
does the merge channel itself need to close? is so how would I know when to do it?
it does, but it closes automatically when all of the channels passed to
merge are closed.