What is Nostr?
(λ. borkdude) /
npub1cnh…el5k
2024-11-01 16:55:50

(λ. borkdude) on Nostr: A wild but perhaps too magic idea: coerce Atoms in squint into Promises such that you ...

A wild but perhaps too magic idea: coerce Atoms in squint into Promises such that you can still use cljs.core/deref on them, but also js-await.
Then we could compile @ to js-await in async contexts and we could write:

(let [resp @(js/fetch "https://clojure.org";) txt @(.text resp)] txt)

etc, while preserving compatibility with atoms.

#clojure #squintcljs
Author Public Key
npub1cnhcxst0q7f90afepa74tfj7dpx3kjvdr9hquudm3wgwyx5zpcrst0el5k