From f7fda221884cebf6e4d78e8a153b5841497d457d Mon Sep 17 00:00:00 2001 From: Thomas de Roo <2+thomas@noreply.localhost> Date: Tue, 16 Jun 2026 10:49:18 +0200 Subject: [PATCH] Add assets/js/app.js --- assets/js/app.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 assets/js/app.js diff --git a/assets/js/app.js b/assets/js/app.js new file mode 100644 index 0000000..c586ca2 --- /dev/null +++ b/assets/js/app.js @@ -0,0 +1,23 @@ +import { initDB } from './db.js'; +import { + getNextWord, + answerWord, + getSessionStats +} from './offline-engine.js'; + +import { + syncQueue +} from './sync.js'; + +await initDB(); + +window.Woordjes = { + getNextWord, + answerWord, + getSessionStats, + syncQueue +}; + +window.addEventListener('online', () => { + syncQueue(); +}); \ No newline at end of file