This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-10
Channels
- # beginners (7)
- # calva (1)
- # cider (8)
- # clojure (21)
- # clojure-austin (5)
- # clojure-dev (26)
- # clojure-europe (7)
- # clojuredesign-podcast (4)
- # clojurescript (2)
- # code-reviews (4)
- # community-development (4)
- # datomic (1)
- # emacs (14)
- # lsp (21)
- # pedestal (8)
- # polylith (16)
- # reitit (6)
- # releases (2)
- # vim (14)
- # xtdb (5)
Anyone working with Dexie and Promesa?
Somehow Promesa can handle plain js promises but doesn't recognize Dexie.Promise
as Promise
EG
(ns fiddle
(:require
[promesa.core :as p]
["dexie" :as dexie]))
(let [js-promise (new js/Promise #(%1 "my-js-promise works"))
dexie-promise (new dexie/Dexie.Promise #(%1 "dexie-promise won't work"))
wrapped-promise (js/Promise.resolve
(new dexie/Dexie.Promise #(%1 "wrapped dexie-promise works")))]
(p/then js-promise js/console.log)
(p/then dexie-promise js/console.log)
(p/then wrapped-promise js/console.log))
Logs
my-js-promise works
DexiePromise {_listeners: Array(0), …}
wrapped dexie-promise works
I don't know enough about js promises but await
does work on Dexie.Promise
. Is this something I could fix in Promesa?
Also I'm just evaluating Promesa to see if it's actually nicer to work with than plain promises, any suggestions on something different is welcome.you need to do this, just for the dexie.promise type (whatever that is) https://github.com/funcool/promesa/blob/master/src/promesa/impl.cljc#L91
🙏 2