aboutsummaryrefslogtreecommitdiff
path: root/06_storage/init_idbfs.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--06_storage/init_idbfs.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/06_storage/init_idbfs.js b/06_storage/init_idbfs.js
new file mode 100644
index 0000000..82483f4
--- /dev/null
+++ b/06_storage/init_idbfs.js
@@ -0,0 +1,16 @@
1Module['preRun'] = [
2 async () => {
3 const dir = "/assets";
4
5 FS.mkdir(dir);
6 FS.mount(IDBFS, { autoPersist: true }, dir);
7
8 Module.fileSystemLoaded = new Promise((resolve, reject) => {
9 FS.syncfs(true, (err) => {
10 if (err) reject(err);
11 else resolve(true);
12 });
13 });
14
15 }
16];

Generated with cgit - Back to sebastiano.tronto.net