以下代码来自dva库。好多js库里都有类似写法,看不明白,不明觉厉。
比如:
_createDva2是干嘛用的?
(0, _createDva2.default)(...) 这种写法是什么鬼?
__esModule似乎在很多库里都有,它是啥嘞?
Object.defineProperty(exports, "__esModule", {
value: true
});
var _reactRouter = require('react-router');
var _reactRouterRedux = require('react-router-redux');
var _createDva = require('./createDva');
var _createDva2 = _interopRequireDefault(_createDva);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = (0, _createDva2.default)({
mobile: false,
initialReducer: {
routing: _reactRouterRedux.routerReducer
},
defaultHistory: _reactRouter.hashHistory,
routerMiddleware: _reactRouterRedux.routerMiddleware,
setupHistory: function setupHistory(history) {
this._history = (0, _reactRouterRedux.syncHistoryWithStore)(history, this._store);
}
});
module.exports = exports['default'];
有只小跳蛙
相关分类