feat: replace raw setInterval polling with shared Poller utility across six frontend modules

This commit is contained in:
2026-06-09 16:37:49 +00:00
parent 1ec011ecb2
commit 66dfda88bc
27 changed files with 282 additions and 350 deletions
+18
View File
@@ -0,0 +1,18 @@
// retoor <retoor@molodetz.nl>
import { Http } from "./Http.js";
import { Toast } from "./Toast.js";
export class OptimisticAction {
async submit(url, params, errorTarget, render) {
try {
const result = await Http.sendForm(url, params);
if (render) render(result);
return result;
} catch (error) {
console.error("optimistic action failed", error);
if (errorTarget) Toast.flash(errorTarget, "Error", 1500);
return null;
}
}
}