提交 9d469c27 编写于 作者: X xinking129

fix sample format

Signed-off-by: Nxinking129 <xinxin13@huawei.com>
上级 cc11c5c6
......@@ -606,13 +606,12 @@ setStaticSubscribeEventState(enable: boolean, callback: AsyncCallback<void>): vo
```ts
import CommonEventManager from '@ohos.commonEventManager'
CommonEventManager.setStaticSubscribeEventState(true, (err) => {
if (err.code) {
console.info(`Set static subscribe event state callback failed, errCode: ${err.code}, errMes: ${err.message}`);
return;
}
console.info(`Set static subscribe event state callback success`);
if (err.code) {
console.info(`Set static subscribe event state callback failed, errCode: ${err.code}, errMes: ${err.message}`);
return;
}
console.info(`Set static subscribe event state callback success`);
});
```
......@@ -652,10 +651,9 @@ setStaticSubscribeEventState(enable: boolean): Promise<void>;
```ts
import CommonEventManager from '@ohos.commonEventManager'
CommonEventManager.setStaticSubscribeEventState(false).then(() => {
console.info(`Set static subscribe event state promise success`);
console.info(`Set static subscribe event state promise success`);
}).catch ((err) => {
console.info(`Set static subscribe event state promise failed, errCode: ${err.code}, errMes: ${err.message}`);
console.info(`Set static subscribe event state promise failed, errCode: ${err.code}, errMes: ${err.message}`);
});
```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册