Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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);
};
Expand All @@ -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('注册应用失败');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down