diff --git a/webxdc.d.ts b/webxdc.d.ts index b2b03a3..c0330d7 100644 --- a/webxdc.d.ts +++ b/webxdc.d.ts @@ -40,7 +40,7 @@ interface Webxdc { * The "serial" specifies the last serial that you know about (defaults to 0). * Note that own status updates, that you send with {@link sendUpdate}, also trigger this method * */ - setUpdateListener(cb: (statusUpdate: ReceivedStatusUpdate) => void, serial: number): void; + setUpdateListener(cb: (statusUpdate: ReceivedStatusUpdate) => void, serial?: number): void; /** * WARNING! This function is deprecated, see setUpdateListener(). */ diff --git a/webxdc.js b/webxdc.js index 7c27cc4..23d483e 100644 --- a/webxdc.js +++ b/webxdc.js @@ -25,7 +25,7 @@ window.webxdc = (() => { return { selfAddr: params.get("addr") || "device0@local.host", selfName: params.get("name") || "device0", - setUpdateListener: (cb, serial) => { + setUpdateListener: (cb, serial = 0) => { var updates = getUpdates(); var maxSerial = updates.length; updates.forEach((update) => {