HubSpot / messenger

Growl-style alerts and messages for your app. #hubspot-open-source
http://github.hubspot.com/messenger/
MIT License
4.02k stars 406 forks source link

Does Messenger work with Jquery promise? #114

Open gregveres opened 8 years ago

gregveres commented 8 years ago

HI

I am wrapping $.ajax in a function that returns $.ajax's JQueryPromise. I then pass that to expectPromise but I get m_opts.action.apply is not a function. Am I doing something wrong or does Messenger not work with JQuery's Promise implementation? I have read that JQuery's Promise implementation is not compliant with Promises/A+.

Here is my call to expectPromise: (this is typescript code).

            Messenger().expectPromise(
                CourtGroupsService.getCourtGroup(this.CourtGroupId()).done((group: CourtGroup) => {
                    this.map(group);
                }),
                {
                    successMessage: 'Court Group reloaded from the server',
                    progresMessage: 'false'
                });

CourtGroupsService.getCourtGroup() returns a JQueryPromise.

Thanks Greg