const { invoke } = window.__TAURI__.core; let cntMsgEl; // async function greet() { // Learn more about Tauri commands at https://tauri.app/develop/calling-rust/ // greetMsgEl.textContent = await invoke("greet", { name: greetInputEl.value }); //} async function aldi() { await invoke("swap", { store: "aldi" }); cntMsgEl.textContent = await invoke("count", {}); } async function rewe() { invoke("swap", { store: "rewe" }); cntMsgEl.textContent = await invoke("count", {}); } window.addEventListener("DOMContentLoaded", () => { cntMsgEl = document.querySelector("#cnt-msg"); document.querySelector("#aldi-form").addEventListener("submit", (e) => { e.preventDefault(); aldi(); }); document.querySelector("#rewe-form").addEventListener("submit", (e) => { e.preventDefault(); rewe(); }); });