We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
fetch()
1 parent 209ccc9 commit 899e167Copy full SHA for 899e167
app/utils/ajax.js
@@ -1,13 +1,12 @@
1
import { runInDebug } from '@ember/debug';
2
-
3
-import fetch from 'fetch';
+import { waitForPromise } from '@ember/test-waiters';
4
5
export default async function ajax(input, init) {
6
let method = init?.method ?? 'GET';
7
8
let cause;
9
try {
10
- let response = await fetch(input, init);
+ let response = await waitForPromise(fetch(input, init));
11
if (response.ok) {
12
return await response.json();
13
}
0 commit comments