export function send_after(timeout, message, dispatch) { return setTimeout(dispatch, timeout, message); } export function cancel_timer(timer) { clearTimeout(timer); } export function now_ms() { return Date.now(); } export function foldp(state, callback) { return (...args) => { const [new_state, result] = callback(state, ...args); state = new_state; return result; }; }