@@ -57,11 +57,10 @@ function asyncComponent(config) {
5757 error : null ,
5858 // Allows us to share the resolver promise across instances.
5959 resolver : null
60- } ;
6160
62- // Takes the given module and if it has a ".default" the ".default" will
63- // be returned. i.e. handy when you could be dealing with es6 imports.
64- var es6Resolve = function es6Resolve ( x ) {
61+ // Takes the given module and if it has a ".default" the ".default" will
62+ // be returned. i.e. handy when you could be dealing with es6 imports.
63+ } ; var es6Resolve = function es6Resolve ( x ) {
6564 return autoResolveES2015Default && x != null && ( typeof x === 'function' || ( typeof x === 'undefined' ? 'undefined' : _typeof ( x ) ) === 'object' ) && x . default ? x . default : x ;
6665 } ;
6766
@@ -141,7 +140,9 @@ function asyncComponent(config) {
141140 } , {
142141 key : 'componentWillMount' ,
143142 value : function componentWillMount ( ) {
144- this . setState ( { module : sharedState . module } ) ;
143+ this . setState ( {
144+ module : sharedState . module
145+ } ) ;
145146 if ( sharedState . error ) {
146147 this . registerErrorState ( sharedState . error ) ;
147148 }
@@ -169,7 +170,9 @@ function asyncComponent(config) {
169170 }
170171 sharedState . module = module ;
171172 if ( env === 'browser' ) {
172- _this3 . setState ( { module : module } ) ;
173+ _this3 . setState ( {
174+ module : module
175+ } ) ;
173176 }
174177 _this3 . resolving = false ;
175178 return module ;
@@ -204,7 +207,9 @@ function asyncComponent(config) {
204207 if ( env === 'browser' ) {
205208 setTimeout ( function ( ) {
206209 if ( ! _this4 . unmounted ) {
207- _this4 . setState ( { error : error } ) ;
210+ _this4 . setState ( {
211+ error : error
212+ } ) ;
208213 }
209214 } , 16 ) ;
210215 }
@@ -230,7 +235,6 @@ function asyncComponent(config) {
230235 }
231236
232237 var Component = es6Resolve ( module ) ;
233- // eslint-disable-next-line no-nested-ternary
234238 return Component ? _react2 . default . createElement ( Component , this . props ) : LoadingComponent ? _react2 . default . createElement ( LoadingComponent , this . props ) : null ;
235239 }
236240 } ] ) ;
@@ -239,6 +243,7 @@ function asyncComponent(config) {
239243 } ( _react2 . default . Component ) ;
240244
241245 AsyncComponent . displayName = name || 'AsyncComponent' ;
246+
242247 AsyncComponent . contextTypes = {
243248 asyncComponentsAncestor : _propTypes2 . default . shape ( {
244249 isBoundary : _propTypes2 . default . bool
@@ -249,13 +254,13 @@ function asyncComponent(config) {
249254 shouldRehydrate : _propTypes2 . default . func . isRequired
250255 } )
251256 } ;
257+
252258 AsyncComponent . childContextTypes = {
253259 asyncComponentsAncestor : _propTypes2 . default . shape ( {
254260 isBoundary : _propTypes2 . default . bool
255261 } )
256262 } ;
257263
258-
259264 return AsyncComponent ;
260265}
261266
0 commit comments