Fix: use cacheFirstCall
This commit is contained in:
parent
525498ea9a
commit
e3316aa811
|
@ -1,9 +1,14 @@
|
||||||
/* global showHelp editorWorker */
|
/* global showHelp editorWorker cacheFirstCall */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
function createLinterHelpDialog(getIssues) {
|
function createLinterHelpDialog(getIssues) {
|
||||||
let csslintRules;
|
let csslintRules;
|
||||||
let preparing;
|
const prepareCsslintRules = cacheFirstCall(() =>
|
||||||
|
editorWorker.getCsslintRules()
|
||||||
|
.then(rules => {
|
||||||
|
csslintRules = rules;
|
||||||
|
})
|
||||||
|
);
|
||||||
return {show};
|
return {show};
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
|
@ -43,14 +48,4 @@ function createLinterHelpDialog(getIssues) {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function prepareCsslintRules() {
|
|
||||||
if (!preparing) {
|
|
||||||
preparing = editorWorker.getCsslintRules()
|
|
||||||
.then(rules => {
|
|
||||||
csslintRules = rules;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return preparing;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user