Does anyone know have to make the cljsjs version of draft.js to work with reagent?
Any particular reason for using cljsjs? I know shadow-cljs allows you to directly consume npm libraries and I thought other cljs build tools did too.
how do you work with promises? is skrat/promesa good? or do you recommend anything else?
This worked for me:
(:require
[cljs.core.async :refer [go]]
[cljs.core.async.interop :refer-macros [<p!]])
(go
; wait for the promise to complete before continuing
(let [result (<p! (fn-returns-a-promise))]
(println "Result" result)
(do-next-thing))
)
I've been noticing some warnings from test.check
about undeclared vars in goog.math.Long
from test/check/random/longs.cljs
when compiling a CLJS project that depends on test.check. I'd like to submit a bug report, but I don't have a JIRA account and it's not clear how to get one from https://github.com/clojure/test.check/blob/master/CONTRIBUTING.md. Can anyone assist or direct me to the right channel to ask this?
Regular JS interop. (.then promise (fn [result] ...))
and all that.
Pretty new to cljs, so there is no clear reason. I'll try shadow-clj. Thank for the help :))
@dgtized The first step is to post it in http://ask.clojure.org
Thanks, I will check that.
Moved to https://ask.clojure.org/index.php/10541/compilation-warnings-undeclared-clojure-check-random-longs
okay
the problem i'm facing is sequence of promises
You haven't really described the problem. What are you trying to do?
i have a vector with objects which describes an http request
i want to execute them serially
Create a function that calls (.then response-promise (fn [result] ...))
and calls itself with (next parameters)
somewhere in the ...
.
Maybe Promesa has something specifically for this scenario, I don't know. I would still use regular interop.
okay, well promesa seems to tidy things a bit