mirror of
https://github.com/status-im/status-go.git
synced 2025-01-11 07:07:24 +00:00
b50c46caa8
* Commit initial change for settimeout/setinterval * Add initial tests for jail setTimeout/setInterval * Add ottoext dependency * Add fetch jail test with function * Add dependencies of fetch from ottoext * Refactor with regards to PR review * Refactor with regards to PR review * Fix syntax errors * Fix missing return statement
18 lines
391 B
JavaScript
18 lines
391 B
JavaScript
const Request = require('./request');
|
|
const Response = require('./response');
|
|
|
|
export default function fetch(input, init) {
|
|
const req = new Request(input, init);
|
|
const res = new Response();
|
|
|
|
return new Promise((resolve, reject) => {
|
|
return __private__fetch_execute(req, res, err => {
|
|
if (err) {
|
|
return reject(err);
|
|
}
|
|
|
|
return resolve(res);
|
|
});
|
|
});
|
|
}
|