-
Notifications
You must be signed in to change notification settings - Fork 3.1k
WePY项目中使用RxJS
Gcaufy edited this page Jan 19, 2018
·
2 revisions
因为RxJS中取global的方式在小程序中不兼容,参见代码 所以需要使用replace插件处理一下:
npm install wepy-async-function rxjs --save
在wepy.config.js里加入以下代码
module.exports.plugins = module.exports.plugins || {};
module.exports.plugins.replace = {
filter: /rxjs[\\\/]util[\\\/].*\.js$/,
config: {
find: 'require(\'./root.js\')',
replace: '{root:require(\'./../../wepy-async-function/global.js\')}'
}
};
import rx from 'rxjs/Rx';
console.log(rx);