TypeScript!

This commit is contained in:
Zaid Abdulla committed 2019-02-20 03:36:52 -08:00
1 parent ee8c43747e
commit 5d3c81cb23
105 files changed
+12054 -1901

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
export let codeMirror;
export let yaml;
export function loadCodeMirror(): Promise<void> {
if (codeMirror) return Promise.resolve();
return new Promise((resolve, reject) => {
const promises = [
import(/* webpackChunkName: "codemirror" */ "codemirror"),
import(/* webpackChunkName: "codemirror" */ "codemirror/mode/javascript/javascript")
];
Promise.all(promises)
.then(modules => {
codeMirror = modules[0];
resolve();
})
.catch(reject);
});
}
export function loadYaml(): Promise<void> {
if (yaml) return Promise.resolve();
return new Promise((resolve, reject) => {
import(/* webpackChunkName: "yaml" */ "yaml")
.then(module => {
yaml = module;
resolve();
})
.catch(reject);
});
}