Fork me on GitHub
#clojurescript
<
2021-04-29
>
Gustav Mark-Hansen20:04:08

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

phronmophobic21:04:01

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.

Gustav Mark-Hansen22:04:17

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

👍 3
Fredrik Andersson21:04:37

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

p-himik22:04:11

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

Fredrik Andersson22:04:17

the problem i'm facing is sequence of promises

p-himik22:04:53

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

Fredrik Andersson22:04:03

i have a vector with objects which describes an http request

Fredrik Andersson22:04:14

i want to execute them serially

p-himik22:04:31

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

p-himik22:04:12

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

Fredrik Andersson22:04:04

okay, well promesa seems to tidy things a bit

Chris Lowe10:05:28

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 Comstock22:04:24

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?

borkdude22:04:09

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

Charles Comstock22:04:10

Thanks, I will check that.