This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-04
Channels
- # beginners (46)
- # boot (65)
- # cider (8)
- # cljs-dev (5)
- # cljsrn (4)
- # clojure (50)
- # clojure-conj (2)
- # clojure-france (1)
- # clojure-greece (18)
- # clojure-russia (8)
- # clojure-spec (39)
- # clojure-uk (36)
- # clojurescript (36)
- # clr (16)
- # component (2)
- # cursive (6)
- # datascript (3)
- # datomic (31)
- # devcards (2)
- # editors-rus (1)
- # emacs (15)
- # events (2)
- # figwheel (1)
- # funcool (24)
- # garden (3)
- # hoplon (22)
- # instaparse (15)
- # leiningen (3)
- # luminus (4)
- # om (59)
- # onyx (24)
- # overtone (1)
- # pedestal (3)
- # planck (18)
- # prelude (1)
- # protorepl (2)
- # re-frame (5)
- # rum (1)
- # sql (1)
- # uncomplicate (1)
- # untangled (66)
- # vim (18)
- # yada (4)
@adamfrey many of the cats facilities for work with promises is already in a separated library: funcool/promesa, and the latest version inclused support for other thenables than bluebird, so probably you can use it with jquery promise abstraction
I’ve been in the Promesa library code, but I didn’t realize that there was support for other promise types. Added 2 days ago at that. just in time! Thanks!
@niwinz With the new version of Promesa I can use promesa.core/then
with a jQuery deferred object just like you said. But when I try to use one in a cats.core/alet
macro, I get a “No context is set…" error
with some cats related protocols in the same way as we do it with bluebird promise object
ok, that’s what I originally thought. But I was mistaken just now in thinking that cats would recognize a jQuery deferred object as some sort of generic promise. Thanks for your help
there are no magic, cats works with types and protocols if some type does not implements its protocols, it will not work with them
I think opening Promesa to other promise implementations is really cool, I played with wrapping Closure promises but didn't get very far. Are you aware of implementations other than the default one based on Bluebird using the promesa protocols? @niwinz
@martinklepsch I'm not aware of
the latest version of promesa supports the usage of other promise types with promesa abstractions
Yeah, I'm by no means suggesting bluebird should be replaced, I'm sure there are good reasons that Promesa is build on top of it 🙂 I just think it'd be nice to also have a version of the library that does 80% without the bluebird dependency (using goog.Promise which is probably included in your build anyways).
doesn't have to be the same lib, could be promesa-closure or whatever which depends on promesa but excludes the bluebird dep or similar
Either way I think this is fine for other people to do that want it (like me) and probably not something you should officially support/implement
I'd just like to have some kind of reference impl that I can use as a base/helps me understand what exactly needs to be done, but maybe @adamfrey makes something on the jQuery promise stuff and that will be just fine 🙂