![npm license](https://camo.githubusercontent.com/cf04a7857ce511a3caff5bfcfa59069524831fe1e7689d8afd0f5e9d78dd7b79/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f6c2f406379636a696d6d792f77656978696e2d6a7373646b2e7376673f7374796c653d666c61742d737175617265)
# via npm
$ npm install @cycjimmy/weixin-jssdk --save
# or via yarn
$ yarn add @cycjimmy/weixin-jssdk
const WxJssdk = require('@cycjimmy/weixin-jssdk');
const wxJssdk = new WxJssdk()
.setWxConfig({
appid: 'your appid',
secret: 'your secret',
})
[.setHook({
getAccessTokenSuccess: new Promise...,
getAccessTokenFromCustom: new Promise...,
})];
wxJssdk.wxshare({
url: 'whole url'
})
.then(data => {
// Do something
// ...
});
wxJssdk.setHook
: [Object] Set Hook Functions.
getAccessTokenSuccess
: [Promise] Run Hook when get Access_Token success. Please resolve Access_Token.
getAccessTokenFromCustom
: [Promise] Run custom task Before get Access_Token from wechat. Please resolve Access_Token.