-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.ts
More file actions
35 lines (32 loc) · 980 Bytes
/
app.ts
File metadata and controls
35 lines (32 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* Bootstrap our app
*/
import { containInMessage, modernizrSupportedFeatures } from './lib/compatibility.fnc';
export function main(): Promise<any> {
return Promise.resolve() // async init of your app
.then(() => {
try {
if (!modernizrSupportedFeatures()) {
// notify of missing rest compatibility
}
// call rest off your app
} catch (error) {
if (error.message && containInMessage(error.message)) {
// notify of missing rest compatibility
}
}
});
}
switch (document.readyState) {
case 'loading':
document.addEventListener('DOMContentLoaded', _domReadyHandler, false);
break;
case 'interactive':
case 'complete':
default:
main();
}
function _domReadyHandler() {
document.removeEventListener('DOMContentLoaded', _domReadyHandler, false);
main();
}