(method, url)
| 3 | |
| 4 | export const requestApi: requestInterface = { |
| 5 | async xhr(method, url) { |
| 6 | if (typeof requestApi.sendMessage !== 'undefined') { |
| 7 | return requestApi.sendMessage({ name: 'xhr', method, url }).then(xhr => { |
| 8 | if (xhr.status === 429) throw 'Rate limit Timeout'; |
| 9 | if (xhr.status === 0) throw xhr.responseText; |
| 10 | return xhr; |
| 11 | }); |
| 12 | } |
| 13 | throw 'Could not send xhr'; |
| 14 | }, |
| 15 | |
| 16 | async sendMessage(message: sendMessageI): Promise<any> { |
| 17 | return new Promise((resolve, reject) => { |
nothing calls this directly
no test coverage detected