Fork me on GitHub
#funcool
<
2016-11-04
>
niwinz07:11:00

@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

adamfrey13:11:23

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!

adamfrey13:11:02

@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

niwinz13:11:55

you should extend the jquery deferred type

niwinz13:11:21

with some cats related protocols in the same way as we do it with bluebird promise object

adamfrey13:11:04

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

niwinz14:11:40

there are no magic, cats works with types and protocols if some type does not implements its protocols, it will not work with them

martinklepsch14:11:39

I think opening Promesa to other promise implementations is really cool, I played with wrapping Closure closurelib 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

niwinz14:11:23

the latest version of promesa supports the usage of other promise types with promesa abstractions

niwinz14:11:48

in fact, it support anything "thenable" in promises vocabulary

niwinz14:11:23

My main concern in replacing bluebird promise is the perfomance and the introspection

niwinz14:11:39

among the debugging stuff such that long stack traces that bluebird has...

martinklepsch14:11:27

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

niwinz14:11:34

hmm is not bad idea but I don't know how we can do it in one unique library

martinklepsch14:11:08

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

martinklepsch14:11:59

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

martinklepsch14:11:03

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 🙂

niwinz14:11:20

I agree with you

niwinz14:11:41

but in some manner I want to have a more lightweight impl for promesa

niwinz15:11:28

bluebird is good in one aspect but no so good in other

niwinz15:11:32

the size of the library