@v4fire/core
Version:
V4Fire core library
20 lines (13 loc) • 575 B
Markdown
This module provides a function that creates a request engine based on the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).
Mind, this API is developed to work in a browser — node.js support only for tests.
* The engine is used by default in a browser if it supports `AbortController`.
* The engine supports response streaming.
```js
import fetchEngine from 'core/request/engines/fetch';
req('/search', {engine: fetchEngine}).then(({response}) => {
console.log(response.decode());
});
```