Home - Webxdc Specification

setUpdateListener

let promise = window.webxdc.setUpdateListener((update) => {}, serial);

With setUpdateListener() you define a callback that receives the updates sent by sendUpdate(). The callback is called for updates sent by you or other peers. The serial specifies the last serial that you know about (defaults to 0). The returned promise resolves when the listener has processed all the update messages known at the time when setUpdateListener was called.

Application update object

Each update which is passed to the callback comes with the following properties:

Calling setUpdateListener() multiple times is undefined behavior: in current implementations only the last invocation works.