Fork me on GitHub
#clojurescript
<
2024-03-13
>
Vladimir Pouzanov16:03:17

hi o/ I get it that async/<!! doesn't exist in cljs because we're technically running a single thread, but what's a good replacement for a REPL use case when I just want to read a single thing from a channel? (something like await read(chan) in the web inspector's console, basically). I can run poll! a few times, but when my api is async and returns a new chan on every call it becomes a bit inconvenient to use.

p-himik16:03:39

I'm not a user of core.async with CLJS, but I'd use take! with a callback that tap>s the result.

Vladimir Pouzanov16:03:50

TIL tap> is a thing. That seems perfect, thanks!