提交 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 ...@@ -606,13 +606,12 @@ setStaticSubscribeEventState(enable: boolean, callback: AsyncCallback<void>): vo
```ts ```ts
import CommonEventManager from '@ohos.commonEventManager'
CommonEventManager.setStaticSubscribeEventState(true, (err) => { CommonEventManager.setStaticSubscribeEventState(true, (err) => {
if (err.code) { if (err.code) {
console.info(`Set static subscribe event state callback failed, errCode: ${err.code}, errMes: ${err.message}`); console.info(`Set static subscribe event state callback failed, errCode: ${err.code}, errMes: ${err.message}`);
return; return;
} }
console.info(`Set static subscribe event state callback success`); console.info(`Set static subscribe event state callback success`);
}); });
``` ```
...@@ -652,10 +651,9 @@ setStaticSubscribeEventState(enable: boolean): Promise<void>; ...@@ -652,10 +651,9 @@ setStaticSubscribeEventState(enable: boolean): Promise<void>;
```ts ```ts
import CommonEventManager from '@ohos.commonEventManager'
CommonEventManager.setStaticSubscribeEventState(false).then(() => { CommonEventManager.setStaticSubscribeEventState(false).then(() => {
console.info(`Set static subscribe event state promise success`); console.info(`Set static subscribe event state promise success`);
}).catch ((err) => { }).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.
先完成此消息的编辑!
想要评论请 注册