mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
update dev-reference to reflect new promise feature for setup (#3220)
* update dev-reference * Update draft/webxdc-dev-reference.md Co-authored-by: holger krekel <holger@merlinux.eu> * Update draft/webxdc-dev-reference.md Co-authored-by: Simon Laux <Simon-Laux@users.noreply.github.com> Co-authored-by: holger krekel <holger@merlinux.eu>
This commit is contained in:
@@ -54,12 +54,13 @@ and you won't get the update by `setUpdateListener()`.
|
||||
### setUpdateListener()
|
||||
|
||||
```js
|
||||
window.webxdc.setUpdateListener((update) => {}, serial);
|
||||
window.webxdc.setUpdateListener((update) => {}, serial) -> Promise<void>;
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
Each `update` which is passed to the callback comes with the following properties:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user