未验证 提交 6d947958 编写于 作者: O openharmony_ci 提交者: Gitee

!2549 database示例代码低错检查问题修改

Merge pull request !2549 from 葛亚芳/master
......@@ -97,7 +97,7 @@
以下为监听对象数据变更的代码示例。
```js
changeCallback : function (sessionId, changeData) {
function changeCallback(sessionId, changeData) {
console.info("change" + sessionId);
if (changeData != null && changeData != undefined) {
......@@ -147,7 +147,7 @@
8. 监听分布式对象的上下线。可以监听对端分布式数据对象的上下线。
以下为访问对象的代码示例:
```js
statusCallback : function (sessionId, networkid, status) {
function statusCallback(sessionId, networkid, status) {
this.response += "status changed " + sessionId + " " + status + " " + networkId;
}
......
......@@ -248,7 +248,7 @@
promise.then(() => {
console.info("setDistributedTables success.")
}).catch((err) => {
console.info("setDistributedTables failed."")
console.info("setDistributedTables failed.")
})
```
......@@ -263,7 +263,7 @@
let predicate = new data_rdb.RdbPredicates('test')
predicate.inDevices(['12345678abcde'])
let promise = rdbStore.sync(rdb.SyncMode.SYNC_MODE_PUSH, predicate)
promise.then(result) {
promise.then((result) => {
console.log('sync done.')
for (let i = 0; i < result.length; i++) {
console.log('device=' + result[i][0] + ' status=' + result[i][1])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册