Skip to content

Commit 1cc89bb

Browse files
authored
Only polyfill Promise if needed (#96)
1 parent b8955e9 commit 1cc89bb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/App.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
let axios = require('axios');
2-
let Promise = require('promise');
32
let {checkType} = require('./helpers');
43
let Models = require('./Models');
54
let Inputs = require('./Inputs');
@@ -8,6 +7,13 @@ let Workflow = require('./Workflow');
87
let {API, ERRORS, getBasePath} = require('./constants');
98
let {TOKEN_PATH} = API;
109

10+
if (typeof window !== 'undefined' && !('Promise' in window)) {
11+
window.Promise = require('promise');
12+
}
13+
14+
if (typeof global !== 'undefined' && !('Promise' in global)) {
15+
global.Promise = require('promise');
16+
}
1117

1218
/**
1319
* top-level class that allows access to models, inputs and concepts

0 commit comments

Comments
 (0)