1cca7abcab
This is extracted from #8094, where I have run into some snags. Since these ESLint fixes aren’t actually connected to the Ember 3.16 update but involve changes to many files, we might as well address them separately. Where possible I fixed the problems but in cases where a fix seemed too involved, I added per-line or -file exceptions.
14 lines
422 B
JavaScript
14 lines
422 B
JavaScript
import fetch from 'fetch';
|
|
import config from '../config/environment';
|
|
|
|
// The ember-fetch polyfill does not provide streaming
|
|
// Additionally, Mirage/Pretender does not support fetch
|
|
const mirageEnabled =
|
|
config.environment !== 'production' &&
|
|
config['ember-cli-mirage'] &&
|
|
config['ember-cli-mirage'].enabled !== false;
|
|
|
|
const fetchToUse = mirageEnabled ? fetch : window.fetch || fetch;
|
|
|
|
export default fetchToUse;
|