Comparing version 2.0.0 to 2.0.1
@@ -35,9 +35,11 @@ 'use strict'; | ||
var app = config.app, | ||
models = config.models, | ||
component = config.component; | ||
resolveModels = config.models, | ||
resolveComponent = config.component; | ||
return (0, _reactAsyncComponent.asyncComponent)((0, _extends3.default)({ | ||
resolve: config.resolve || function () { | ||
var models = typeof resolveModels === 'function' ? resolveModels() : []; | ||
var component = resolveComponent(); | ||
return new _promise2.default(function (resolve) { | ||
_promise2.default.all([].concat((0, _toConsumableArray3.default)(models || []), [component])).then(function (ret) { | ||
_promise2.default.all([].concat((0, _toConsumableArray3.default)(models), [component])).then(function (ret) { | ||
if (!models || !models.length) { | ||
@@ -44,0 +46,0 @@ return resolve(ret[0]); |
{ | ||
"name": "dva", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "React and redux based, lightweight and elm-style framework.", | ||
@@ -35,3 +35,4 @@ "repository": { | ||
"dependencies": { | ||
"dva-core": "^1.0.0", | ||
"babel-runtime": "^6.26.0", | ||
"dva-core": "^1.0.1", | ||
"global": "^4.3.2", | ||
@@ -38,0 +39,0 @@ "history": "^4.6.3", |
@@ -12,7 +12,9 @@ import { asyncComponent } from 'react-async-component'; | ||
export default function dynamic(config) { | ||
const { app, models, component } = config; | ||
const { app, models: resolveModels, component: resolveComponent } = config; | ||
return asyncComponent({ | ||
resolve: config.resolve || function () { | ||
const models = typeof resolveModels === 'function' ? resolveModels() : []; | ||
const component = resolveComponent(); | ||
return new Promise((resolve) => { | ||
Promise.all([...(models || []), component]).then((ret) => { | ||
Promise.all([...models, component]).then((ret) => { | ||
if (!models || !models.length) { | ||
@@ -19,0 +21,0 @@ return resolve(ret[0]); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1770344
25436
13
26
+ Addedbabel-runtime@^6.26.0
+ Addedbabel-runtime@6.26.0(transitive)
Updateddva-core@^1.0.1