JSteunou / webstomp-client

Stomp client over websocket for browsers
Apache License 2.0
299 stars 59 forks source link

Use promises instead of callbacks #1

Open Polve opened 8 years ago

Polve commented 8 years ago

Since this library is mostly a rewrite of the old one, I think it makes sense to use ES6 and promises instead of callbacks. This does not restrict its use on browsers due to browserify and promises polyfill. An example of library using es6 promise polyfill is https://github.com/matthew-andrews/isomorphic-fetch

JSteunou commented 8 years ago

Agreed it is on my todo list. PRs are welcome if you wanna try. Le 2 avr. 2016 08:59, "Alessandro Polverini" notifications@github.com a écrit :

Since this library is mostly a rewrite of the old one, I think it makes sense to use ES6 and promises instead of callbacks. This does not restrict its use on browsers due to browserify and promises polyfill. An example of library using es6 promise polyfill is https://github.com/matthew-andrews/isomorphic-fetch

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/JSteunou/webstomp-client/issues/1

DzmitryShylovich commented 8 years ago

I think Observables from rxjs is a better choice as they have a lot of advantages over promises.

Observables and type definitions will make this library very attractive to use in conjunction with angular 2 (second version of the most popular front end framework).

JSteunou commented 8 years ago

PR are welcomed @DzmitryShylovich ;)

fpozzobon commented 7 years ago

I've created a library with observable (strongly inspired from yours, I hope you don't mind about that :)) you can see it on https://github.com/fpozzobon/webstomp-obs I didn't want to create a PR as the usage of it is a lot different in fact...