Chaining promises in ClojureScript is best done using the thread-first macro, ->
. Here's an example of using the fetch API:
(-> (js/fetch "/data")
(.then (fn [r]
(when-not (.-ok r)
(throw (js/Error. "Could not fetch /data")))
(.json r)))