我的目标是创建一个方法来加载一个返回promise的对象。当我有一个回调时,我只需要调用'toPromise‘,它从回调中创建Promise。public loadIntervention( numFI : number ) : Promise<Intervention> if ( !this.Connected ) // here is the callback that detects reconnection
jQuery</em
例如,如果我像这样定义代码$.getJSON('https://api.coindesk.com/v1/bpi/historical/close.json?start=2013-09-01&end=2013-09-05', function( data ) {});但是,如果我像这样定义代码$.getJSON('https://api.coindesk.com/v1/bpi/historical/close.json?start=