fix: wrap top-level async

This commit is contained in:
草鞋没号 2021-11-20 17:27:13 +08:00
parent eaf33fedba
commit 30f4299d1e
1 changed files with 6 additions and 4 deletions

View File

@ -39,8 +39,10 @@ const store = {
await invoke('electron-store', 'set', key, val)
}
},
}
};
await store.set('Date.now', Date.now())
console.log('electron-store ->', 'Date.now:', await store.get('Date.now'))
console.log('electron-store ->', 'path:', await window.bridge.ipcRenderer.invoke('electron-store', 'path'))
(async () => {
await store.set('Date.now', Date.now())
console.log('electron-store ->', 'Date.now:', await store.get('Date.now'))
console.log('electron-store ->', 'path:', await window.bridge.ipcRenderer.invoke('electron-store', 'path'))
})();