feat: improvement to template

This commit is contained in:
xhayper
2022-12-22 00:58:54 +07:00
parent 67bbe33498
commit bafa8ae8ae
23 changed files with 189 additions and 120 deletions

View File

@@ -1,5 +1,5 @@
function domReady(condition: DocumentReadyState[] = ['complete', 'interactive']) {
return new Promise(resolve => {
return new Promise((resolve) => {
if (condition.includes(document.readyState)) {
resolve(true)
} else {
@@ -85,7 +85,7 @@ function useLoading() {
const { appendLoading, removeLoading } = useLoading()
domReady().then(appendLoading)
window.onmessage = ev => {
window.onmessage = (ev) => {
ev.data.payload === 'removeLoading' && removeLoading()
}