diff --git a/index.js b/index.js index 5d1ca37..8fbfef8 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,15 @@ */ import {NativeModules, NativeAppEventEmitter} from 'react-native'; -import promisify from 'es6-promisify'; + +function promisify(fn, handler) { + return function (...args) { + return new Promise(function (resolve, reject) { + fn(...args, handler.bind({ resolve, reject })) + }) + } +} + const {WeiboAPI} = NativeModules; diff --git a/package.json b/package.json index 5bc592b..d94cc3d 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,5 @@ "url": "https://github.com/reactnativecn/react-native-weibo/issues" }, "homepage": "https://github.com/reactnativecn/react-native-weibo#readme", - "dependencies": { - "es6-promisify": "^3.0.0" - } + "dependencies": {} }