angular2-busy icon indicating copy to clipboard operation
angular2-busy copied to clipboard

Suggestion: Make ng2Busy work with all `thenable`s

Open canibanoglu opened this issue 9 years ago • 0 comments

Hello,

I really like the idea behind angular2-busy and I had a suggestion about extending its support to not only Promises but thenables in general.

There are some libraries out there, most notably jQuery, which does not support the Promises/A+ spec and as a result they won't work with angular2-busy right away. In a project I'm working on I had to wrap a thenable in a proper Promise just so I could get the loading indicator off the screen once the thenable was fulfilled.

As far as I can see from the code this would not be a major change as the PromiseTrackerService only uses the .then method of the promise if promise is an instance of Promise. Checking if the promise object has a .then method (in effect checking if it is a thenable) would alleviate this "problem".

I would love to hear your thoughts on this.

Cheers,

Can

canibanoglu avatar Nov 03 '16 21:11 canibanoglu