提交 46814db7 编写于 作者: L li_juntao

修改distributedObject开发指南错误

Signed-off-by: Nli_juntao <lijuntao9@huawei.com>
上级 c5014b51
......@@ -148,18 +148,18 @@
8. 监听分布式对象的上下线。可以监听对端分布式数据对象的上下线。
以下为访问对象的代码示例:
```js
function statusCallback(sessionId, networkid, status) {
function statusCallback(sessionId, networkId, status) {
this.response += "status changed " + sessionId + " " + status + " " + networkId;
}
local_object.on("status", this.changeCallback);
local_object.on("status", this.statusCallback);
```
9. 删除监听分布式对象的上下线。可以指定删除监听的上下线回调;也可以不指定,这将会删除该分布式数据对象的所有上下线回调。
以下为取消监听数据变更的代码示例:
```js
//删除上下线回调changeCallback
local_object.off("status", changeCallback);
//删除上下线回调statusCallback
local_object.off("status", statusCallback);
//删除所有的上下线回调
local_object.off("status");
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册