From 25847d7ded24d1a161400628448cd44225965b0e Mon Sep 17 00:00:00 2001 From: dongmk Date: Tue, 12 Dec 2023 12:46:27 +0000 Subject: [PATCH] update README_zh.md. Signed-off-by: Mingkai Dong --- README.md | 2 +- README_zh.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 886377d0d..76484bc6f 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ The following example describes how to use NAPI to develop a JS API for obtainin The prototype of the JS API is as follows: ``` -function getAppName(): string; +function getAppName(): Promise; ``` The implementation code of the JS API is as follows: diff --git a/README_zh.md b/README_zh.md index 719a1db8c..0dff0a93b 100644 --- a/README_zh.md +++ b/README_zh.md @@ -147,7 +147,7 @@ NAPI适合封装IO、CPU密集型、OS底层等能力并对外暴露JS接口, 我们要实现的JS接口原型是: ``` -function getAppName(): string; +function getAppName(): Promise; ``` 以下是实现源码: @@ -180,7 +180,7 @@ napi_value JSGetAppName(napi_env env, napi_callback_info info) { napi_value resourceName; napi_create_string_latin1(env, "GetAppName", NAPI_AUTO_LENGTH, &resourceName); - // 创建异步任务队列 + // 创建异步任务并加入队列 napi_create_async_work( env, nullptr, resourceName, // 异步任务的回调 -- Gitee