boundless-async
Advanced tools
Comparing version 1.0.4 to 1.1.0
@@ -1,2 +0,2 @@ | ||
module.exports=function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var t={};return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=3)}([function(e,n){e.exports=require("boundless-utils-omit-keys")},function(e,n){e.exports=require("classnames")},function(e,n){e.exports=require("react")},function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function o(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function i(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var u=t(2),l=(t.n(u),t(1)),s=t.n(l),c=t(0),a=t.n(c),p=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},f=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),d=function(e,n,t){return n.split(".").reduce(function(e,n){return e[n]||t},e)},h=function(e){function n(){var e,t,i,u;r(this,n);for(var l=arguments.length,s=Array(l),c=0;c<l;c++)s[c]=arguments[c];return t=i=o(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(s))),i.mounted=!1,i.promise=null,i.state={},u=t,o(i,u)}return i(n,e),f(n,[{key:"handlePromiseFulfillment",value:function(e,n){this.mounted&&this.setState(function(t){return this.promise===e?(this.promise=null,{component:n}):t},this.fireRenderCallback)}},{key:"handleChildren",value:function(e){var n=e;if(t.i(u.isValidElement)(n))return this.setState({component:n},this.fireRenderCallback);if("function"==typeof n)return this.handleChildren(n(this.props));var r=this.handlePromiseFulfillment.bind(this,n);this.promise=n,this.setState({component:null},function(){return n.then(r,r)})}},{key:"fireRenderCallback",value:function(){this.state.component&&this.props.childrenDidRender()}},{key:"componentWillMount",value:function(){this.handleChildren(this.props.children)}},{key:"componentDidMount",value:function(){this.mounted=!0}},{key:"componentWillReceiveProps",value:function(e){this.handleChildren(e.children)}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"render",value:function(){var e=this.props,r=this.state;return t.i(u.cloneElement)(r.component||e.pendingContent,p({},a()(e,n.internalKeys),{className:s()("b-async",e.className,null===r.component&&d(e,"pendingContent.props.className"),r.component&&d(r,"component.props.className",""),{"b-async-pending":null===r.component})}))}}]),n}(u.PureComponent);h.propTypes={"*":u.PropTypes.any,children:u.PropTypes.oneOfType([u.PropTypes.func,u.PropTypes.node,u.PropTypes.instanceOf(Promise)]).isRequired,childrenDidRender:u.PropTypes.func,pendingContent:u.PropTypes.node},h.defaultProps={children:t.i(u.createElement)("div",null),childrenDidRender:function(){},pendingContent:t.i(u.createElement)("div",null)},h.internalKeys=Object.keys(h.defaultProps),n.default=h}]); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vaW5kZXguanMiLCJ3ZWJwYWNrOi8vL3dlYnBhY2svYm9vdHN0cmFwIDg4NmNmYzExNjBhMmE2M2JhMmM3Iiwid2VicGFjazovLy9leHRlcm5hbCB7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1bmN0aW9uIHRoYXQgcmV0dXJucyBhIHByb21pc2UsIG9yIG90aGVyIHR5cGUgb2YgcmVuZGVyYWJsZSBjb250ZW50OyBpZiBhIGZ1bmN0aW9uIGlzIHBhc3NlZCwgaXQgd2lsbFxuICAgICAgICAgKiBiZSBjYWxsZWQgd2l0aCB0aGUgY3VycmVudCBwcm9wc1xuICAgICAgICAgKlxuICAgICAgICAgKiBQcm9taXNlIGV4YW1wbGU6XG4gICAgICAgICAqXG4gICAgICAgICAqIGBgYGpzeFxuICAgICAgICAgKiBjb25zdCBsaXN0RGF0YVByb21pc2UgPSBmZXRjaCgnL3NvbWUvbGlzdC9kYXRhL2VuZHBvaW50JykudGhlbihcbiAgICAgICAgICogICAgIChyZXNwb25zZSkgPT4gcmVzcG9uc2Uub2sgPyByZXNwb25zZS5qc29uKCkgOiAnRmFpbGVkIHRvIHJlY2VpdmUgbGlzdCBkYXRhJyxcbiAgICAgICAgICogICAgIChlcnJvcikgPT4gZXJyb3IubWVzc2FnZSxcbiAgICAgICAgICogKS50aGVuKChwYXlsb2FkKSA9PiB7XG4gICAgICAgICAqICAgICBpZiAodHlwZW9mIHBheWxvYWQgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAqICAgICAgICAgcmV0dXJuICg8ZGl2IGNsYXNzTmFtZT0nZXJyb3InPntwYXlsb2FkfTwvZGl2Pik7XG4gICAgICAgICAqICAgICB9XG4gICAgICAgICAqXG4gICAgICAgICAqICAgICByZXR1cm4gKFxuICAgICAgICAgKiAgICAgICAgIDx1bD5cbiAgICAgICAgICogICAgICAgICAgICAge3BheWxvYWQubWFwKChpdGVtKSA9PiAoPGxpIGtleT17aXRlbS5pZH0+e2l0ZW0uY29udGVudH08L2xpPikpfVxuICAgICAgICAgKiAgICAgICAgIDwvdWw+XG4gICAgICAgICAqICAgICApO1xuICAgICAgICAgKiB9KTtcbiAgICAgICAgICpcbiAgICAgICAgICogPEFzeW5jPntsaXN0RGF0YVByb21pc2V9PC9Bc3luYz5cbiAgICAgICAgICogYGBgXG4gICAgICAgICAqXG4gICAgICAgICAqIEZ1bmN0aW9uIGV4YW1wbGUsIHJlYWRpbmcgaW4gYFtkYXRhLWVuZHBvaW50XWAgYXMgdGhlIGB3aW5kb3cuZmV0Y2goKWAgdGFyZ2V0OlxuICAgICAgICAgKlxuICAgICAgICAgKiBgYGBqc3hcbiAgICAgICAgICogY29uc3QgZmV0Y2hMaXN0RGF0YSA9IChwcm9wcykgPT4gZmV0Y2gocHJvcHNbJ2RhdGEtZW5kcG9pbnQnXSkudGhlbihcbiAgICAgICAgICogICAgIChyZXNwb25zZSkgPT4gcmVzcG9uc2Uub2sgPyByZXNwb25zZS5qc29uKCkgOiAnRmFpbGVkIHRvIHJlY2VpdmUgbGlzdCBkYXRhJyxcbiAgICAgICAgICogICAgIChlcnJvcikgPT4gZXJyb3IubWVzc2FnZSxcbiAgICAgICAgICogKS50aGVuKChwYXlsb2FkKSA9PiB7XG4gICAgICAgICAqICAgICBpZiAodHlwZW9mIHBheWxvYWQgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAqICAgICAgICAgcmV0dXJuICg8ZGl2IGNsYXNzTmFtZT0nZXJyb3InPntwYXlsb2FkfTwvZGl2Pik7XG4gICAgICAgICAqICAgICB9XG4gICAgICAgICAqXG4gICAgICAgICAqICAgICByZXR1cm4gKFxuICAgICAgICAgKiAgICAgICAgIDx1bD5cbiAgICAgICAgICogICAgICAgICAgICAge3BheWxvYWQubWFwKChpdGVtKSA9PiAoPGxpIGtleT17aXRlbS5pZH0+e2l0ZW0uY29udGVudH08L2xpPikpfVxuICAgICAgICAgKiAgICAgICAgIDwvdWw+XG4gICAgICAgICAqICAgICApO1xuICAgICAgICAgKiB9KTtcbiAgICAgICAgICpcbiAgICAgICAgICogPEFzeW5jIGRhdGEtZW5kcG9pbnQ9Jy9zb21lL2xpc3QvZGF0YS9lbmRwb2ludCc+e2ZldGNoTGlzdERhdGF9PC9Bc3luYz5cbiAgICAgICAgICogYG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BzdGF0ZX0gPSB0aGlzO1xuXG4gICAgICAgIHJldHVybiBjbG9uZUVsZW1lbnQoc3RhdGUuY29tcG9uZW50IHx8IHByb3BzLnBlbmRpbmdDb250ZW50LCB7XG4gICAgICAgICAgICAuLi5vbWl0KHByb3BzLCBBc3luYy5pbnRlcm5hbEtleXMpLFxuICAgICAgICAgICAgY2xhc3NOYW1lOiBjeChcbiAgICAgICAgICAgICAgICAnYi1hc3luYycsXG4gICAgICAgICAgICAgICAgcHJvcHMuY2xhc3NOYW1lLFxuICAgICAgICAgICAgICAgIHN0YXRlLmNvbXBvbmVudCA9PT0gbnVsbCAmJiBnZXQocHJvcHMsICdwZW5kaW5nQ29udGVudC5wcm9wcy5jbGFzc05hbWUnKSxcbiAgICAgICAgICAgICAgICBzdGF0ZS5jb21wb25lbnQgJiYgZ2V0KHN0YXRlLCAnY29tcG9uZW50LnByb3BzLmNsYXNzTmFtZScsICcnKSxcbiAgICAgICAgICAgICAgICB7J2ItYXN5bmMtcGVuZGluZyc6IHN0YXRlLmNvbXBvbmVudCA9PT0gbnVsbH1cbiAgICAgICAgICAgICksXG4gICAgICAgIH0pO1xuICAgIH1cbn1cblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyAuL3BhY2thZ2VzL2JvdW5kbGVzcy1hc3luYy9pbmRleC5qcyJdLCJzb3VyY2VSb290IjoiIn0= | ||
module.exports=function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var t={};return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=8)}([function(e,n,t){"function"==typeof Symbol&&Symbol.iterator;e.exports=t(6)()},function(e,n){e.exports=require("boundless-utils-omit-keys")},function(e,n){e.exports=require("classnames")},function(e,n){e.exports=require("react")},function(e,n,t){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,n,t){"use strict";function r(e,n,t,r,i,u,s,a){if(o(n),!e){var c;if(void 0===n)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[t,r,i,u,s,a],p=0;c=new Error(n.replace(/%s/g,function(){return l[p++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(e){};e.exports=r},function(e,n,t){"use strict";var r=t(4),o=t(5),i=t(7);e.exports=function(){function e(e,n,t,r,u,s){s!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function n(){return e}e.isRequired=e;var t={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:n,element:e,instanceOf:n,node:e,objectOf:n,oneOf:n,oneOfType:n,shape:n};return t.checkPropTypes=r,t.PropTypes=t,t}},function(e,n,t){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,n,t){"use strict";function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function o(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function i(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var u=t(0),s=t.n(u),a=t(3),c=(t.n(a),t(2)),l=t.n(c),p=t(1),f=t.n(p),d=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},h=function(){function e(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(n,t,r){return t&&e(n.prototype,t),r&&e(n,r),n}}(),m=function(e,n,t){return n.split(".").reduce(function(e,n){return e[n]||t},e)},y=function(e){function n(){var e,t,i,u;r(this,n);for(var s=arguments.length,a=Array(s),c=0;c<s;c++)a[c]=arguments[c];return t=i=o(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(a))),i.mounted=!1,i.promise=null,i.state={},u=t,o(i,u)}return i(n,e),h(n,[{key:"handlePromiseFulfillment",value:function(e,n){this.mounted&&this.setState(function(t){return this.promise===e?(this.promise=null,{component:n}):t},this.fireRenderCallback)}},{key:"handleChildren",value:function(e){var n=e;if(t.i(a.isValidElement)(n))return this.setState({component:n},this.fireRenderCallback);if("function"==typeof n)return this.handleChildren(n(this.props));var r=this.handlePromiseFulfillment.bind(this,n);this.promise=n,this.setState({component:null},function(){return n.then(r,r)})}},{key:"fireRenderCallback",value:function(){this.state.component&&this.props.childrenDidRender()}},{key:"componentWillMount",value:function(){this.handleChildren(this.props.children)}},{key:"componentDidMount",value:function(){this.mounted=!0}},{key:"componentWillReceiveProps",value:function(e){this.handleChildren(e.children)}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"render",value:function(){var e=this.props,r=this.state;return t.i(a.cloneElement)(r.component||e.pendingContent,d({},f()(e,n.internalKeys),{className:l()("b-async",e.className,null===r.component&&m(e,"pendingContent.props.className"),r.component&&m(r,"component.props.className",""),{"b-async-pending":null===r.component})}))}}]),n}(a.PureComponent);y.propTypes={"*":s.a.any,children:s.a.oneOfType([s.a.func,s.a.node,s.a.instanceOf(Promise)]).isRequired,childrenDidRender:s.a.func,pendingContent:s.a.node},y.defaultProps={children:t.i(a.createElement)("div",null),childrenDidRender:function(){},pendingContent:t.i(a.createElement)("div",null)},y.internalKeys=Object.keys(y.defaultProps),n.default=y}]); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vaW5kZXguanMiLCJ3ZWJwYWNrOi8vL3dlYnBhY2svYm9vdHN0cmFwIDI0MGM2ZDA5NzE3Mzc0NzdjMjdiIiwid2VicGFjazovLy8uL34vcHJvcC10eXBlcy9pbmRleC5qcyIsIndlYnBhY2s6Ly8vZXh0ZXJuYWwge1wiY29tbW9uanMyXCI6XCJib3VuZGxlc3MtdXRpbHMtb21pdC1rZXlzXCJ9Iiwid2VicGFjazovLy9leHRlcm5hbCB7XCJjb21tb25qczJcIjpcImNsYXNzbmFtZXNcIn0iLCJ3ZWJwYWNrOi8vL2V4dGVybmFsIHtcImNvbW1vbmpzMlwiOlwicmVhY3RcIn0iLCJ3ZWJwYWNrOi8vLy4vfi9mYmpzL2xpYi9lbXB0eUZ1bmN0aW9uLmpzIiwid2VicGFjazovLy8uL34vZmJqcy9saWIvaW52YXJpYW50LmpzIiwid2VicGFjazovLy8uL34vcHJvcC10eXBlcy9mYWN0b3J5V2l0aFRocm93aW5nU2hpbXMuanMiLCJ3ZWJwYWNrOi8vLy4vfi9wcm9wLXR5cGVzL2xpYi9SZWFjdFByb3BUeXBlc1NlY3JldC5qcyIsIndlYnBhY2s6Ly8vLi9wYWNrYWdlcy9ib3VuZGxlc3MtYXN5bmMvaW5kZXguanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsIm1vZHVsZXMiLCJfX3dlYnBhY2tfcmVxdWlyZV9fIiwibW9kdWxlSWQiLCJpbnN0YWxsZWRNb2R1bGVzIiwiaSIsImwiLCJjYWxsIiwibSIsImMiLCJ2YWx1ZSIsImQiLCJuYW1lI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4gICAgICAgICAqICAgICAoZXJyb3IpID0+IGVycm9yLm1lc3NhZ2UsXG4gICAgICAgICAqICkudGhlbigocGF5bG9hZCkgPT4ge1xuICAgICAgICAgKiAgICAgaWYgKHR5cGVvZiBwYXlsb2FkID09PSAnc3RyaW5nJykge1xuICAgICAgICAgKiAgICAgICAgIHJldHVybiAoPGRpdiBjbGFzc05hbWU9J2Vycm9yJz57cGF5bG9hZH08L2Rpdj4pO1xuICAgICAgICAgKiAgICAgfVxuICAgICAgICAgKlxuICAgICAgICAgKiAgICAgcmV0dXJuIChcbiAgICAgICAgICogICAgICAgICA8dWw+XG4gICAgICAgICAqICAgICAgICAgICAgIHtwYXlsb2FkLm1hcCgoaXRlbSkgPT4gKDxsaSBrZXk9e2l0ZW0uaWR9PntpdGVtLmNvbnRlbnR9PC9saT4pKX1cbiAgICAgICAgICogICAgICAgICA8L3VsPlxuICAgICAgICAgKiAgICAgKTtcbiAgICAgICAgICogfSk7XG4gICAgICAgICAqXG4gICAgICAgICAqIDxBc3luYz57bGlzdERhdGFQcm9taXNlfTwvQXN5bmM+XG4gICAgICAgICAqIGBgYFxuICAgICAgICAgKlxuICAgICAgICAgKiBGdW5jdGlvbiBleGFtcGxlLCByZWFkaW5nIGluIGBbZGF0YS1lbmRwb2ludF1gIGFzIHRoZSBgd2luZG93LmZldGNoKClgIHRhcmdldDpcbiAgICAgICAgICpcbiAgICAgICAgICogYGBganN4XG4gICAgICAgICAqIGNvbnN0IGZldGNoTGlzdERhdGEgPSAocHJvcHMpID0+IGZldGNoKHByb3BzWydkYXRhLWVuZHBvaW50J10pLnRoZW4oXG4gICAgICAgICAqICAgICAocmVzcG9uc2UpID0+IHJlc3BvbnNlLm9rID8gcmVzcG9uc2UuanNvbigpIDogJ0ZhaWxlZCB0byByZWNlaXZlIGxpc3QgZGF0YScsXG4gICAgICAgICAqICAgICAoZXJyb3IpID0+IGVycm9yLm1lc3NhZ2UsXG4gICAgICAgICAqICkudGhlbigocGF5bG9hZCkgPT4ge1xuICAgICAgICAgKiAgICAgaWYgKHR5cGVvZiBwYXlsb2FkID09PSAnc3RyaW5nJykge1xuICAgICAgICAgKiAgICAgICAgIHJldHVybiAoPGRpdiBjbGFzc05hbWU9J2Vycm9yJz57cGF5bG9hZH08L2Rpdj4pO1xuICAgICAgICAgKiAgICAgfVxuICAgICAgICAgKlxuICAgICAgICAgKiAgICAgcmV0dXJuIChcbiAgICAgICAgICogICAgICAgICA8dWw+XG4gICAgICAgICAqICAgICAgICAgICAgIHtwYXlsb2FkLm1hcCgoaXRlbSkgPT4gKDxsaSBrZXk9e2l0ZW0uaWR9PntpdGVtLmNvbnRlbnR9PC9saT4pKX1cbiAgICAgICAgICogICAgICAgICA8L3VsPlxuICAgICAgICAgKiAgICAgKTtcbiAgICAgICAgICogfSk7XG4gICAgICAgICAqXG4gICAgICAgICAqIDxBc3luYyBkYXRhLWVuZHBvaW50PScvc29tZS9saXN0L2RhdGEvZW5kcG9pbnQnPntmZXRjaExpc3REYXRhfTwvQXN5bmM+XG4gICAgICAgICAqIGBgYFxuICAgICAgICAgKi9cbiAgICAgICAgY2hpbGRyZW46IFByb3BUeXBlcy5vbmVPZlR5cGUoW1xuICAgICAgICAgICAgUHJvcFR5cGVzLmZ1bmMsXG4gICAgICAgICAgICBQcm9wVHlwZXMubm9kZSxcbiAgICAgICAgICAgIFByb3BUeXBlcy5pbnN0YW5jZU9mKFByb21pc2UpLFxuICAgICAgICBdKS5pc1JlcXVpcmVkLFxuXG4gICAgICAgIC8qKiBhIGNhbGxiYWNrIGZvciB3aGVuIHJlYWwgY29udGVudCBoYXMgYmVlbiByZW5kZXJlZDsgdGhpcyB3aWxsIGJlIGNhbGxlZCBpbW1lZGlhdGVseSBpZiBub3JtYWwgSlNYIGlzIHBhc3NlZCB0byBBc3luYywgb3IsIGluIHRoZSBjYXNlIG9mIGEgcHJvbWlzZSwgdXBvbiByZXNvbHV0aW9uIG9yIHJlamVjdGlvbiAqL1xuICAgICAgICBjaGlsZH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ICAgICAgaWYgKHRoaXMuc3RhdGUuY29tcG9uZW50KSB7XG4gICAgICAgICAgICB0aGlzLnByb3BzLmNoaWxkcmVuRGlkUmVuZGVyKCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBjb21wb25lbnRXaWxsTW91bnQoKSAgICAgICAgICAgICAgICAgeyB0aGlzLmhhbmRsZUNoaWxkcmVuKHRoaXMucHJvcHMuY2hpbGRyZW4pOyB9XG4gICAgY29tcG9uZW50RGlkTW91bnQoKSAgICAgICAgICAgICAgICAgIHsgdGhpcy5tb3VudGVkID0gdHJ1ZTsgfVxuICAgIGNvbXBvbmVudFdpbGxSZWNlaXZlUHJvcHMobmV4dFByb3BzKSB7IHRoaXMuaGFuZGxlQ2hpbGRyZW4obmV4dFByb3BzLmNoaWxkcmVuKTsgfVxuICAgIGNvbXBvbmVudFdpbGxVbm1vdW50KCkgICAgICAgICAgICAgICB7IHRoaXMubW91bnRlZCA9IGZhbHNlOyB9XG5cbiAgICByZW5kZXIoKSB7XG4gICAgICAgIGNvbnN0IHsgcHJvcHMsIHN0YXRlIH0gPSB0aGlzO1xuXG4gICAgICAgIHJldHVybiBjbG9uZUVsZW1lbnQoc3RhdGUuY29tcG9uZW50IHx8IHByb3BzLnBlbmRpbmdDb250ZW50LCB7XG4gICAgICAgICAgICAuLi5vbWl0KHByb3BzLCBBc3luYy5pbnRlcm5hbEtleXMpLFxuICAgICAgICAgICAgY2xhc3NOYW1lOiBjeChcbiAgICAgICAgICAgICAgICAnYi1hc3luYycsXG4gICAgICAgICAgICAgICAgcHJvcHMuY2xhc3NOYW1lLFxuICAgICAgICAgICAgICAgIHN0YXRlLmNvbXBvbmVudCA9PT0gbnVsbCAmJiBnZXQocHJvcHMsICdwZW5kaW5nQ29udGVudC5wcm9wcy5jbGFzc05hbWUnKSxcbiAgICAgICAgICAgICAgICBzdGF0ZS5jb21wb25lbnQgJiYgZ2V0KHN0YXRlLCAnY29tcG9uZW50LnByb3BzLmNsYXNzTmFtZScsICcnKSxcbiAgICAgICAgICAgICAgICB7ICdiLWFzeW5jLXBlbmRpbmcnOiBzdGF0ZS5jb21wb25lbnQgPT09IG51bGwgfVxuICAgICAgICAgICAgKSxcbiAgICAgICAgfSk7XG4gICAgfVxufVxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vcGFja2FnZXMvYm91bmRsZXNzLWFzeW5jL2luZGV4LmpzIl0sInNvdXJjZVJvb3QiOiIifQ== |
13
index.js
@@ -1,2 +0,3 @@ | ||
import {cloneElement, createElement, isValidElement, PropTypes, PureComponent} from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { cloneElement, createElement, isValidElement, PureComponent } from 'react'; | ||
import cx from 'classnames'; | ||
@@ -101,3 +102,3 @@ | ||
return {component: payload}; | ||
return { component: payload }; | ||
} | ||
@@ -113,3 +114,3 @@ | ||
if (isValidElement(content)) { | ||
return this.setState({component: content}, this.fireRenderCallback); | ||
return this.setState({ component: content }, this.fireRenderCallback); | ||
} else if (typeof content === 'function') { | ||
@@ -124,3 +125,3 @@ return this.handleChildren(content(this.props)); | ||
this.setState({component: null}, () => content.then(boundHandler, boundHandler)); | ||
this.setState({ component: null }, () => content.then(boundHandler, boundHandler)); | ||
} | ||
@@ -140,3 +141,3 @@ | ||
render() { | ||
const {props, state} = this; | ||
const { props, state } = this; | ||
@@ -150,3 +151,3 @@ return cloneElement(state.component || props.pendingContent, { | ||
state.component && get(state, 'component.props.className', ''), | ||
{'b-async-pending': state.component === null} | ||
{ 'b-async-pending': state.component === null } | ||
), | ||
@@ -153,0 +154,0 @@ }); |
/* eslint no-unused-expressions:0 */ | ||
import {createElement} from 'react'; | ||
import { createElement } from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
@@ -8,3 +8,3 @@ import sinon from 'sinon'; | ||
import Async from './index'; | ||
import {$, conformanceChecker} from '../boundless-utils-test-helpers/index'; | ||
import { $, conformanceChecker } from '../boundless-utils-test-helpers/index'; | ||
@@ -11,0 +11,0 @@ describe('Async higher-order component', () => { |
{ | ||
"name": "boundless-async", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "A higher-order component for rendering data that isn't ready yet.", | ||
@@ -24,3 +24,3 @@ "author": "Evan Scott <probablyup@gmail.com> (http://yaycmyk.com) (http://yaycmyk.com)", | ||
"dependencies": { | ||
"boundless-utils-omit-keys": "^1.0.4", | ||
"boundless-utils-omit-keys": "^1.1.0", | ||
"classnames": "^2.1.5" | ||
@@ -27,0 +27,0 @@ }, |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
71725
352