未验证 提交 4a249f82 编写于 作者: 葛亚芳 提交者: Gitee

update en/application-dev/database/database-distributedobject-guidelines.md.

Signed-off-by: N@ge-yafang <geyafang@huawei.com>
上级 535c0eef
......@@ -147,11 +147,11 @@ The following example shows how to implement a distributed data object synchroni
8. Subscribe to the status (online/offline) changes of the distributed data object. A callback will be invoked to report the status change when the target distributed data object goes online or offline.
The sample code is as follows:
```js
statusCallback : function (sessionId, networkid, status) {
statusCallback : function (sessionId, networkId, status) {
this.response += "status changed " + sessionId + " " + status + " " + networkId;
}
local_object.on("status", this.changeCallback);
local_object.on("status", this.statusCallback);
```
9. Unsubscribe from the status changes of the distributed data object. You can specify the callback to unsubscribe from. If you do not specify the callback, all status change callbacks will be unsubscribe from.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册