From 963342c9e54c014461946a0dffebb06b16ef8130 Mon Sep 17 00:00:00 2001 From: Wang Xu Date: Sun, 12 Mar 2017 18:07:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3RN0.42=20=E5=AE=89?= =?UTF-8?q?=E5=8D=93=E4=B8=8B=E6=8A=A5=E9=94=99=E9=97=AA=E9=80=80=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E5=B0=86es6-promisify=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=B8=BAbluebird?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index ac27380..ec00cb9 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,6 @@ import { NativeAppEventEmitter, NativeModules } from 'react-native'; -import promisify from 'es6-promisify'; +// import promisify from 'es6-promisify'; +import Promise from 'bluebird' const WeChatAPI = NativeModules.WeChatAPI; @@ -57,7 +58,7 @@ function wrapCheckApi(nativeFunc) { return undefined; } - const promisified = promisify(nativeFunc, translateError); + const promisified = Promise.promisify(nativeFunc, translateError); return (...args) => { return promisified(...args); }; @@ -71,7 +72,7 @@ function wrapApi(nativeFunc) { return undefined; } - const promisified = promisify(nativeFunc, translateError); + const promisified = Promise.promisify(nativeFunc, translateError); return async function (...args) { if (!WeChatAPI.isAppRegistered) { throw new Error('注册应用失败'); From 5db08f3cd504d285853e474c1c5034bd8d5a4b38 Mon Sep 17 00:00:00 2001 From: Wang Xu Date: Sun, 12 Mar 2017 18:09:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3RN0.42=20=E5=AE=89?= =?UTF-8?q?=E5=8D=93=E4=B8=8B=E6=8A=A5=E9=94=99=E9=97=AA=E9=80=80=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E5=B0=86es6-promisify=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=B8=BAbluebird?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c22a7d2..d729019 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ }, "homepage": "https://github.com/reactnativecn/react-native-wx#readme", "dependencies": { - "es6-promisify": "^3.0.0" + "bluebird": "^3.5.0" }, "peerDependencies": { "react-native": "^0.33.0"