未验证 提交 2282b3e6 编写于 作者: O openharmony_ci 提交者: Gitee

!3193 distributedobject分布式数据对象开发指导issue问题修改,无需翻译

Merge pull request !3193 from 葛亚芳/OpenHarmony-3.1-Release
...@@ -147,11 +147,11 @@ The following example shows how to implement a distributed data object synchroni ...@@ -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. 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: The sample code is as follows:
```js ```js
statusCallback : function (sessionId, networkid, status) { statusCallback : function (sessionId, networkId, status) {
this.response += "status changed " + sessionId + " " + status + " " + networkId; 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. 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.
......
...@@ -148,11 +148,11 @@ ...@@ -148,11 +148,11 @@
8. 监听分布式对象的上下线。可以监听对端分布式数据对象的上下线。 8. 监听分布式对象的上下线。可以监听对端分布式数据对象的上下线。
以下为访问对象的代码示例: 以下为访问对象的代码示例:
```js ```js
function statusCallback(sessionId, networkid, status) { function statusCallback(sessionId, networkId, status) {
this.response += "status changed " + sessionId + " " + status + " " + networkId; this.response += "status changed " + sessionId + " " + status + " " + networkId;
} }
local_object.on("status", this.changeCallback); local_object.on("status", this.statusCallback);
``` ```
9. 删除监听分布式对象的上下线。可以指定删除监听的上下线回调;也可以不指定,这将会删除该分布式数据对象的所有上下线回调。 9. 删除监听分布式对象的上下线。可以指定删除监听的上下线回调;也可以不指定,这将会删除该分布式数据对象的所有上下线回调。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册