Makes it compatible with standard ES6 Promise, and also
allows the browser to respond sooner to user input (if there was
any) rather than (synchronously) continuing within this same async
block.
Change-Id: I82aac439cecd7680f53a82649196c9168eda6755
var userGroups = mw.config.get( 'wgUserGroups', [] );
// Uses promise for backwards compatibility
- return $.Deferred().resolve( userGroups ).done( callback );
+ return $.Deferred().resolve( userGroups ).then( callback );
},
/**
return getUserInfo().then(
function ( userInfo ) { return userInfo.rights; },
function () { return []; }
- ).done( callback );
+ ).then( callback );
}
} );