我有一个源模块:
import _ from 'underscore'
import {Observable} from 'rxjs'
export default function (rxfb) {
return {
getProperties () {
return rxfb.sources.user.getUser()
.switchMap(({properties}) =>
properties
? Observable.combineLatest(_(properties).map((property, propertyId) =>
this.getProperty(propertyId).map(property => ({propertyId, ...property}))))
: Observable.from([{}]))
}
}
}
我需要从另一个部分访问它,所以我要导入它:
import myProperties from '../../sources/properties'
然后我试着:
console.log(myProperties.getProperties())
但它不起作用,什么是获得这种方法的正确途径?