This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-01
Channels
- # announcements (1)
- # aws (3)
- # beginners (150)
- # boot (12)
- # calva (7)
- # carry (3)
- # cider (1)
- # clara (51)
- # cljdoc (17)
- # cljs-dev (17)
- # cljsrn (1)
- # clojure (64)
- # clojure-austin (2)
- # clojure-india (1)
- # clojure-italy (10)
- # clojure-nl (4)
- # clojure-spec (42)
- # clojure-uk (63)
- # clojurescript (24)
- # core-async (23)
- # cursive (6)
- # datascript (7)
- # datomic (5)
- # figwheel-main (43)
- # fulcro (74)
- # hoplon (7)
- # kaocha (30)
- # leiningen (32)
- # mount (51)
- # nrepl (34)
- # off-topic (29)
- # re-frame (6)
- # reagent (10)
- # reitit (13)
- # shadow-cljs (66)
- # slack-help (3)
- # spacemacs (2)
- # specter (5)
- # sql (2)
- # tools-deps (51)
- # yada (13)
👋 I'm all over the place today... Is it possible to deref
a promise-chan
in CLJS? I can't find any docs on dereferencing channels anywhere... The only place I've heard about it is in Rich Hickey's "Inside Transducers" talk, but I'm starving for docs... I have a use case wherein such semantics would be well suited
a promise chan can be read like any other channel
after it has been written to, it will repeatedly give that value every time it is read
In Rich's talk he said that they can also have deref'able semantics?
ah, ok
bummer!
right
that's what I wanted to do 😄
I was hoping there was a "parking" deref or something
why not use a parking channel read?
but something that didn't require I wrap everything in a go block
then use take! with a callback arg?
basically, I'm being lazy in making something local remote and refactoring it to be async
that's probably the best way
I'll give that a go
the semantics/contract is just going to be way different
what used to be a value (subordinate) is going to end up being a superordinate
I tried to use an atom
and reset!
it asynchronously, which worked with those nice semantics not having to change, but it required the function to be called twice to "hydrate" the atom