react-lazy-loadable
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -13,4 +13,4 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var React = require("react"); | ||
var PropTypes = require("prop-types"); | ||
var React = require('react'); | ||
var PropTypes = require('prop-types'); | ||
@@ -21,3 +21,3 @@ var ALL_INITIALIZERS = []; | ||
function isWebpackReady(getModuleIds) { | ||
if ((typeof __webpack_modules__ === "undefined" ? "undefined" : _typeof(__webpack_modules__)) !== "object") { | ||
if ((typeof __webpack_modules__ === 'undefined' ? 'undefined' : _typeof(__webpack_modules__)) !== 'object') { | ||
return false; | ||
@@ -27,3 +27,3 @@ } | ||
return getModuleIds().every(function (moduleId) { | ||
return typeof moduleId !== "undefined" && typeof __webpack_modules__[moduleId] !== "undefined"; | ||
return typeof moduleId !== 'undefined' && typeof __webpack_modules__[moduleId] !== 'undefined'; | ||
}); | ||
@@ -109,3 +109,3 @@ } | ||
if (!options.loading) { | ||
throw new Error("react-loadable requires a `loading` component"); | ||
throw new Error('react-loadable requires a `loading` component'); | ||
} | ||
@@ -134,3 +134,3 @@ | ||
if (typeof opts.webpack === "function") { | ||
if (typeof opts.webpack === 'function') { | ||
READY_INITIALIZERS.push(function () { | ||
@@ -173,3 +173,3 @@ if (isWebpackReady(opts.webpack)) { | ||
LoadableComponent.prototype.componentDidMount = function componentDidMount() { | ||
LoadableComponent.prototype.UNSAFE_componentWillMount = function UNSAFE_componentWillMount() { | ||
this._mounted = true; | ||
@@ -192,3 +192,3 @@ this._loadModule(); | ||
if (typeof opts.delay === "number") { | ||
if (typeof opts.delay === 'number') { | ||
if (opts.delay === 0) { | ||
@@ -203,3 +203,3 @@ this.setState({ pastDelay: true }); | ||
if (typeof opts.timeout === "number") { | ||
if (typeof opts.timeout === 'number') { | ||
this._timeout = setTimeout(function () { | ||
@@ -270,4 +270,4 @@ _this2.setState({ timedOut: true }); | ||
function LoadableMap(opts) { | ||
if (typeof opts.render !== "function") { | ||
throw new Error("LoadableMap requires a `render(loaded, props)` function"); | ||
if (typeof opts.render !== 'function') { | ||
throw new Error('LoadableMap requires a `render(loaded, props)` function'); | ||
} | ||
@@ -274,0 +274,0 @@ |
{ | ||
"name": "react-lazy-loadable", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A higher order component for loading components with promises", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
53178