Fork me on GitHub

Hi everyone! I'm looking at using these react components with an Om app. Is this possible?


I have read this and this post makes good sense to me. It is the HOC aspect of the stripe ones that I am getting hung up on

Oliver George02:05:28

Hi. Is there a low fuss way of doing await in clojurescript without depending on core.async? Context is I want to treat an async api which uses promises as blocking.


@olivergeorge the promesa library has some macros that emulate await. i have found that it isn’t perfectly general but it does work


you can also just use then and catch as they are normal methods. the promesa library helps with the ergonomics of that too

Oliver George03:05:49

Thanks. I'll check promesa out.

Oliver George03:05:00

(scratch that)


oh be sure to check out the alet macro they have. i have found that when i really need await-like semantics, that’s good enough and it is more “clojureish”


but again, you can just use promises using js interop

Oliver George03:05:09

Yeah, it's the blocking bit which complicates. Perhaps I'm asking for something silly.


i mean, keep in mind, await does not really block. it just makes code that looks like it blocks. any function in javascript that uses await returns a promise

Oliver George03:05:52

Okay, perhaps it's not really what I'm after.


you literally cannot block. it’s the hard lesson of javascript 🙂


(well in node you can, but not in the browser)

Oliver George03:05:15

(FYI I'm thinking about re-frame event handlers. There's no place for async data preparation before they run which makes async data sources inconvenient and incompatible as coeffects.)


try in #re-frame because they’ve definitely thought about how to do this in some proper way. i don’t use it myself because words like coeffects are scary 😛

Oliver George03:05:55

🙂 will do. For what it's worth you learn to love them.


by the way, my random guess is that the answer will be: do it async and fire off another event when the result comes back

Oliver George03:05:16

Yeah, I think you are right. I could wrap that up so it's a little less verbose too.


yeah, I use async storage as an effect, not a coeffect, and fire off an event when the result comes back


Question about resolving protocols in ClojureScript,

(defprotocol Testy
  (testy-this [_]))
In Clojure I can get a list of the signatures:
(:sigs Testy)
{:testy-this {:name testy-this, :arglists ([_]), :doc nil}}

;; or in a macro
(:sigs @(resolve Testy))
In ClojureScript both of these give me nil, is there another way to get a list of the signatures of a Protocol in CLJS?


@alexanderjamesking I don't think this is guaranteed to always work, but

(-> #'Testy meta :protocol-info :methods)


Thanks @mfikes - that looks to have done the trick


hey all I have I'm going through the om basic tutorial at . My om/root looks like:

  (fn [data owner]
      (apply dom/ul #js {:className "animals"}
        (map stripe (:list data) (cycle ["#ff0" "#fff"])))))
  {:target (. js/document (getElementById "app0"))})
and when my app-state (`data` in the om/root scope) is:
(defonce app-state (atom {:text "Hello world!"}))
I get no warnings or errors even though the code should be mapping over the data. Is this normal?


more specifically: Why is this not an error?