clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
Gustav Mark-Hansen 2021-04-29T20:31:08.044700Z

Does anyone know have to make the cljsjs version of draft.js to work with reagent?

phronmophobic 2021-04-29T21:45:01.044800Z

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.

Fredrik Andersson 2021-04-29T21:52:37.045700Z

how do you work with promises? is skrat/promesa good? or do you recommend anything else?

Chris Lowe 2021-05-17T10:49:28.033Z

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))
      )

Charles Comstock 2021-04-29T22:02:24.048600Z

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?

p-himik 2021-04-29T22:03:11.048900Z

Regular JS interop. (.then promise (fn [result] ...)) and all that.

Gustav Mark-Hansen 2021-04-29T22:04:17.049100Z

Pretty new to cljs, so there is no clear reason. I'll try shadow-clj. Thank for the help :))

👍 1
borkdude 2021-04-29T22:06:09.049500Z

@dgtized The first step is to post it in http://ask.clojure.org

Charles Comstock 2021-04-29T22:08:10.050100Z

Thanks, I will check that.

Fredrik Andersson 2021-04-29T22:24:36.050500Z

okay

Fredrik Andersson 2021-04-29T22:25:17.050800Z

the problem i'm facing is sequence of promises

p-himik 2021-04-29T22:36:53.051200Z

You haven't really described the problem. What are you trying to do?

Fredrik Andersson 2021-04-29T22:38:03.051400Z

i have a vector with objects which describes an http request

Fredrik Andersson 2021-04-29T22:38:14.051600Z

i want to execute them serially

p-himik 2021-04-29T22:40:31.051800Z

Create a function that calls (.then response-promise (fn [result] ...)) and calls itself with (next parameters) somewhere in the ....

p-himik 2021-04-29T22:41:12.052Z

Maybe Promesa has something specifically for this scenario, I don't know. I would still use regular interop.

Fredrik Andersson 2021-04-29T22:42:04.052200Z

okay, well promesa seems to tidy things a bit