Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

boundless-async

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boundless-async - npm Package Compare versions

Comparing version 1.0.0-beta.6 to 1.0.0-beta.7

build/style.css

4

build/index.js

@@ -1,2 +0,2 @@

module.exports=function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,n){"use strict";function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object.keys(t).reduce(function(n,o){return e.indexOf(o)===-1&&(n[o]=t[o]),n},{})}e.a=o},function(t,e){t.exports=require("classnames")},function(t,e){t.exports=require("react")},function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var c=n(2),i=n.n(c),s=n(1),u=n.n(s),l=n(0),p=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},f=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),d=function(t){function e(){var t,n,a,c;o(this,e);for(var i=arguments.length,s=Array(i),u=0;u<i;u++)s[u]=arguments[u];return n=a=r(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(s))),a.mounted=!1,a.state={},c=n,r(a,c)}return a(e,t),f(e,[{key:"convertDataToJSXOrWait",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,n=e.data;return n instanceof Promise?(this.setState({component:null}),n.then(function(e){t.mounted&&t.setState(function(t,o){return{component:o.data===n?o.convertToJSXFunc(e):t.component}})},function(){return t.setState({component:!1})})):void this.setState({component:e.convertToJSXFunc(n)})}},{key:"fireCallbackIfDataRendered",value:function(){this.state.component&&this.props.contentRenderedFunc()}},{key:"componentWillMount",value:function(){this.convertDataToJSXOrWait()}},{key:"componentDidMount",value:function(){this.mounted=!0,this.fireCallbackIfDataRendered()}},{key:"componentDidUpdate",value:function(){this.fireCallbackIfDataRendered()}},{key:"componentWillReceiveProps",value:function(t){this.convertDataToJSXOrWait(t)}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"getClasses",value:function(t){return u()("b-async",this.props.className,t,{"b-async-error":this.state.component===!1,"b-async-loading":null===this.state.component})}},{key:"render",value:function(){return null===this.state.component||this.state.component===!1?i.a.createElement("div",p({},n.i(l.a)(this.props,e.internalKeys),{className:this.getClasses()}),null===this.state.component?this.props.loadingContent:this.props.errorContent):i.a.cloneElement(this.state.component,p({},n.i(l.a)(this.props,e.internalKeys),{className:this.getClasses(this.state.component.props&&this.state.component.props.className)}))}}]),e}(i.a.PureComponent);d.propTypes={contentRenderedFunc:c.PropTypes.func,convertToJSXFunc:c.PropTypes.func,data:c.PropTypes.any,errorContent:c.PropTypes.node,loadingContent:c.PropTypes.node},d.defaultProps={contentRenderedFunc:function(){},convertToJSXFunc:function(t){return t},data:null,errorContent:"⚠️",loadingContent:null},d.internalKeys=Object.keys(d.defaultProps),e.default=d}]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vaW5kZXguanMiLCJ3ZWJwYWNrOi8vL3dlYnBhY2svYm9vdHN0cmFwIGMzNmUzYmQ4YzNlMDJiNWI1MjVhIiwid2VicGFjazovLy8uL3BhY2thZ2VzL2JvdW5kbGVzcy11dGlscy1vbWl0LWtleXMvaW5kZXguanMiLCJ3ZWJwYWNrOi8vL2V4dGVybmFsIHtcImNvbW1vbmpzMlwiOlwiY2xhc3NuYW1lc1wifSIsIndlYnBhY2s6Ly8vZXh0ZXJuYWwge1wiY29tbW9uanMyXCI6XCJyZWFjdFwifSIsIndlYnBhY2s6Ly8vLi9wYWNrYWdlcy9ib3VuZGxlc3MtYXN5bmMvaW5kZXguanMiXSwibmFtZXMiOlsibW9kdWxlIiwiZXhwb3J0cyIsIm1vZHVsZXMiLCJfX3dlYnBhY2tfcmVxdWlyZV9fIiwibW9kdWxlSWQiLCJpbnN0YWxsZWRNb2R1bGVzIiwiaSIsImwiLCJjYWxsIiwibSIsImMiLCJ2YWx1ZSIsImQiLCJuYW1lIiwiZ2V0dGVyIiwibyIsIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiY29uZmlndXJhYmxlIiwiZW51bWVyYWJsZSIsImdldCIsIm4iLCJfX2VzTW9kdWxlIiwib2JqZWN0IiwicHJvcGVydHkiLCJwcm90b3R5cGUiLCJoYXNPd25Qcm9wZXJ0eSIsInAiLCJzIiwiX193ZWJwYWNrX2V4cG9ydHNfXyIsIm9taXRLZXlzRnJvbVNvdXJjZU9iamVjdCIsInNvdXJjZSIsIm9taXR0ZWRLZXlzIiwiYXJndW1lbnRzIiwibGVuZ3RoIiwidW5kZWZpbmVk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Z0NvbnRlbnQ6IG51bGwsXG4gICAgfVxuXG4gICAgc3RhdGljIGludGVybmFsS2V5cyA9IE9iamVjdC5rZXlzKEFzeW5jLmRlZmF1bHRQcm9wcylcblxuICAgIG1vdW50ZWQgPSBmYWxzZVxuICAgIHN0YXRlID0ge31cblxuICAgIGNvbnZlcnREYXRhVG9KU1hPcldhaXQocHJvcHMgPSB0aGlzLnByb3BzKSB7XG4gICAgICAgIGNvbnN0IHtkYXRhfSA9IHByb3BzO1xuXG4gICAgICAgIGlmIChkYXRhIGluc3RhbmNlb2YgUHJvbWlzZSkge1xuICAgICAgICAgICAgdGhpcy5zZXRTdGF0ZSh7Y29tcG9uZW50OiBudWxsfSk7XG5cbiAgICAgICAgICAgIHJldHVybiBkYXRhLnRoZW4oKHBheWxvYWQpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5tb3VudGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIG9ubHkgcmVwbGFjZSBpZiB3ZSdyZSBsb29raW5nIGF0IHRoZSBzYW1lIHByb21pc2UsIG90aGVyd2lzZSBkbyBub3RoaW5nXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0U3RhdGUoKHN0YXRlLCBjdXJyZW50UHJvcHMpID0+ICh7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnQ6IGN1cnJlbnRQcm9wcy5kYXRhID09PSBkYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gY3VycmVudFByb3BzLmNvbnZlcnRUb0pTWEZ1bmMocGF5bG9hZClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBzdGF0ZS5jb21wb25lbnQsXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LCAoKSA9PiB0aGlzLnNldFN0YXRlKHtjb21wb25lbnQ6IGZhbHNlfSkpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpc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WxsLFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICByZW5kZXIoKSB7XG4gICAgICAgIGlmICh0aGlzLnN0YXRlLmNvbXBvbmVudCA9PT0gbnVsbCB8fCB0aGlzLnN0YXRlLmNvbXBvbmVudCA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgPGRpdiB7Li4ub21pdCh0aGlzLnByb3BzLCBBc3luYy5pbnRlcm5hbEtleXMpfSBjbGFzc05hbWU9e3RoaXMuZ2V0Q2xhc3NlcygpfT5cbiAgICAgICAgICAgICAgICAgICAge3RoaXMuc3RhdGUuY29tcG9uZW50ID09PSBudWxsXG4gICAgICAgICAgICAgICAgICAgICA/IHRoaXMucHJvcHMubG9hZGluZ0NvbnRlbnRcbiAgICAgICAgICAgICAgICAgICAgIDogdGhpcy5wcm9wcy5lcnJvckNvbnRlbnR9XG4gICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICApO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIFJlYWN0LmNsb25lRWxlbWVudCh0aGlzLnN0YXRlLmNvbXBvbmVudCwge1xuICAgICAgICAgICAgLi4ub21pdCh0aGlzLnByb3BzLCBBc3luYy5pbnRlcm5hbEtleXMpLFxuICAgICAgICAgICAgY2xhc3NOYW1lOiB0aGlzLmdldENsYXNzZXModGhpcy5zdGF0ZS5jb21wb25lbnQucHJvcHMgJiYgdGhpcy5zdGF0ZS5jb21wb25lbnQucHJvcHMuY2xhc3NOYW1lKSxcbiAgICAgICAgfSk7XG4gICAgfVxufVxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vcGFja2FnZXMvYm91bmRsZXNzLWFzeW5jL2luZGV4LmpzIl0sInNvdXJjZVJvb3QiOiIifQ==
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),s=t(1),c=t.n(s),a=t(0),p=t.n(a),f=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},d=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}}(),h=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 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),d(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(l.a.isValidElement(n))return this.setState({component:n},this.fireRenderCallback);if("function"==typeof n)return this.handleChildren(n(this.props));var t=this.handlePromiseFulfillment.bind(this,n);this.promise=n,this.setState({component:null},function(){return n.then(t,t)})}},{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,t=this.state;return l.a.cloneElement(t.component||e.pendingContent,f({},p()(e,n.internalKeys),{className:c()("b-async",e.className,null===t.component&&h(e,"pendingContent.props.className"),t.component&&h(t,"component.props.className",""),{"b-async-pending":null===t.component})}))}}]),n}(l.a.PureComponent);y.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},y.defaultProps={children:l.a.createElement("div",null),childrenDidRender:function(){},pendingContent:l.a.createElement("div",null)},y.internalKeys=Object.keys(y.defaultProps),n.default=y}]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vaW5kZXguanMiLCJ3ZWJwYWNrOi8vL3dlYnBhY2svYm9vdHN0cmFwIGY1MWYwNTM1MmQwZTg1ZTNhNjk5Iiwid2VicGFjazovLy9leHRlcm5hbCB7XCJjb21tb25qczJcIjpcImJvdW5kbGVzcy11dGlscy1vbWl0LWtleXNcIn0iLCJ3ZWJwYWNrOi8vL2V4dGVybmFsIHtcImNvbW1vbmpzMlwiOlwiY2xhc3NuYW1lc1wifSIsIndlYnBhY2s6Ly8vZXh0ZXJuYWwge1wi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HJldHVybnMgYSBwcm9taXNlLCBvciBvdGhlciB0eXBlIG9mIHJlbmRlcmFibGUgY29udGVudDsgaWYgYSBmdW5jdGlvbiBpcyBwYXNzZWQsIGl0IHdpbGxcbiAgICAgICAgICogYmUgY2FsbGVkIHdpdGggdGhlIGN1cnJlbnQgcHJvcHNcbiAgICAgICAgICpcbiAgICAgICAgICogUHJvbWlzZSBleGFtcGxlOlxuICAgICAgICAgKlxuICAgICAgICAgKiBgYGBqc3hcbiAgICAgICAgICogY29uc3QgbGlzdERhdGFQcm9taXNlID0gZmV0Y2goJy9zb21lL2xpc3QvZGF0YS9lbmRwb2ludCcpLnRoZW4oXG4gICAgICAgICAqICAgICAocmVzcG9uc2UpID0+IHJlc3BvbnNlLm9rID8gcmVzcG9uc2UuanNvbigpIDogJ0ZhaWxlZCB0byByZWNlaXZlIGxpc3QgZGF0YScsXG4gICAgICAgICAqICAgICAoZXJyb3IpID0+IGVycm9yLm1lc3NhZ2UsXG4gICAgICAgICAqICkudGhlbigocGF5bG9hZCkgPT4ge1xuICAgICAgICAgKiAgICAgaWYgKHR5cGVvZiBwYXlsb2FkID09PSAnc3RyaW5nJykge1xuICAgICAgICAgKiAgICAgICAgIHJldHVybiAoPGRpdiBjbGFzc05hbWU9J2Vycm9yJz57cGF5bG9hZH08L2Rpdj4pO1xuICAgICAgICAgKiAgICAgfVxuICAgICAgICAgKlxuICAgICAgICAgKiAgICAgcmV0dXJuIChcbiAgICAgICAgICogICAgICAgICA8dWw+XG4gICAgICAgICAqICAgICAgICAgICAgIHtwYXlsb2FkLm1hcCgoaXRlbSkgPT4gKDxsaSBrZXk9e2l0ZW0uaWR9PntpdGVtLmNvbnRlbnR9PC9saT4pKX1cbiAgICAgICAgICogICAgICAgICA8L3VsPlxuICAgICAgICAgKiAgICAgKTtcbiAgICAgICAgICogfSk7XG4gICAgICAgICAqXG4gICAgICAgICAqIDxBc3luYz57bGlzdERhdGFQcm9taXNlfTwvQXN5bmM+XG4gICAgICAgICAqXG4gICAgICAgICAqIEZ1bmN0aW9uIGV4YW1wbGU6XG4gICAgICAgICAqXG4gICAgICAgICAqIGBgYGpzeFxuICAgICAgICAgKiBjb25zdCBmZXRjaExpc3REYXRhID0gKHByb3BzKSA9PiBmZXRjaChwcm9wc1snZGF0YS1lbmRwb2ludCddKS50aGVuKFxuICAgICAgICAgKiAgICAgKHJlc3BvbnNlKSA9PiByZXNwb25zZS5vayA/IHJlc3BvbnNlLmpzb24oKSA6ICdGYWlsZWQgdG8gcmVjZWl2ZSBsaXN0IGRhdGEnLFxuICAgICAgICAgKiAgICAgKGVycm9yKSA9PiBlcnJvci5tZXNzYWdlLFxuICAgICAgICAgKiApLnRoZW4oKHBheWxvYWQpID0+IHtcbiAgICAgICAgICogICAgIGlmICh0eXBlb2YgcGF5bG9hZCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICogICAgICAgICByZXR1cm4gKDxkaXYgY2xhc3NOYW1lPSdlcnJvcic+e3BheWxvYWR9PC9kaXY+KTtcbiAgICAgICAgICogICAgIH1cbiAgICAgICAgICpcbiAgICAgICAgICogICAgIHJldHVybiAoXG4gICAgICAgICAqICAgICAgICAgPHVsPlxuICAgICAgICAgKiAgICAgICAgICAgICB7cGF5bG9hZC5tYXAoKGl0ZW0pID0+ICg8bGkga2V5PXtpdGVtLmlkfT57aXRlbS5jb250ZW50fTwvbGk+KSl9XG4gICAgICAgICAqICAgICAgICAgPC91bD5cbiAgICAgICAgICogICAgICk7XG4gICAgICAgICAqIH0pO1xuICAgICAgICAgKlxuICAgICAgICAgKiA8QXN5bmMgZGF0YS1lbmRwb2ludD0nL3NvbWUvbGlzdC9kYXRhL2VuZHBvaW50Jz57ZmV0Y2hMaXN0RGF0YX08L0FzeW5jPlxuICAgICAgICAgKiBgYGBcbiAgICAgICAgICovXG4gICAgICAgIGNoaWxkcmVuOiBQcm9wVHlwZXMub25lT2ZUeXBlKFtcbiAgICAgICAgICAgIFByb3BUeXBlcy5mdW5jLFxuICAgICAg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luZ0NvbnRlbnQsIHtcbiAgICAgICAgICAgIC4uLm9taXQocHJvcHMsIEFzeW5jLmludGVybmFsS2V5cyksXG4gICAgICAgICAgICBjbGFzc05hbWU6IGN4KFxuICAgICAgICAgICAgICAgICdiLWFzeW5jJyxcbiAgICAgICAgICAgICAgICBwcm9wcy5jbGFzc05hbWUsXG4gICAgICAgICAgICAgICAgc3RhdGUuY29tcG9uZW50ID09PSBudWxsICYmIGdldChwcm9wcywgJ3BlbmRpbmdDb250ZW50LnByb3BzLmNsYXNzTmFtZScpLFxuICAgICAgICAgICAgICAgIHN0YXRlLmNvbXBvbmVudCAmJiBnZXQoc3RhdGUsICdjb21wb25lbnQucHJvcHMuY2xhc3NOYW1lJywgJycpLFxuICAgICAgICAgICAgICAgIHsnYi1hc3luYy1wZW5kaW5nJzogc3RhdGUuY29tcG9uZW50ID09PSBudWxsfVxuICAgICAgICAgICAgKSxcbiAgICAgICAgfSk7XG4gICAgfVxufVxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vcGFja2FnZXMvYm91bmRsZXNzLWFzeW5jL2luZGV4LmpzIl0sInNvdXJjZVJvb3QiOiIifQ==

@@ -6,5 +6,5 @@ import React, {PropTypes} from 'react';

const get = (base, path, fallback) => path.split('.').reduce((current, fragment) => current[fragment] || fallback, base);
/**
* # Async
* __A higher-order component for rendering data that isn't ready yet.__

@@ -15,28 +15,73 @@ *

* that pattern by handling common types of promises and providing a simple mechanism
* for materializing the resolved data into JSX.
* for materializing the fulfilled payload into JSX.
*/
export default class Async extends React.PureComponent {
static propTypes = {
/** a callback for when real content has been rendered; either normal passed data or when a passed promise resolves */
contentRenderedFunc: PropTypes.func,
/**
* any [React-supported attribute](https://facebook.github.io/react/docs/tags-and-attributes.html#html-attributes)
*/
'*': PropTypes.any,
/** a function that takes the resolved payload of a promise provided by `props.data` and returns renderable JSX; defaults to trying to render the resolved value of the Promise */
convertToJSXFunc: PropTypes.func,
/**
* a promise, function that returns a promise, or other type of renderable content; if a function is passed, it will
* be called with the current props
*
* Promise example:
*
* ```jsx
* const listDataPromise = fetch('/some/list/data/endpoint').then(
* (response) => response.ok ? response.json() : 'Failed to receive list data',
* (error) => error.message,
* ).then((payload) => {
* if (typeof payload === 'string') {
* return (<div className='error'>{payload}</div>);
* }
*
* return (
* <ul>
* {payload.map((item) => (<li key={item.id}>{item.content}</li>))}
* </ul>
* );
* });
*
* <Async>{listDataPromise}</Async>
*
* Function example:
*
* ```jsx
* const fetchListData = (props) => fetch(props['data-endpoint']).then(
* (response) => response.ok ? response.json() : 'Failed to receive list data',
* (error) => error.message,
* ).then((payload) => {
* if (typeof payload === 'string') {
* return (<div className='error'>{payload}</div>);
* }
*
* return (
* <ul>
* {payload.map((item) => (<li key={item.id}>{item.content}</li>))}
* </ul>
* );
* });
*
* <Async data-endpoint='/some/list/data/endpoint'>{fetchListData}</Async>
* ```
*/
children: PropTypes.oneOfType([
PropTypes.func,
PropTypes.node,
PropTypes.instanceOf(Promise),
]).isRequired,
/** a promise, or some other piece of data to be run through `props.convertToJSXFunc` */
data: PropTypes.any,
/** a callback for when real content has been rendered; this will be called immediately if normal JSX is passed to Async, or, in the case of a promise, upon resolution or rejection */
childrenDidRender: PropTypes.func,
/** content to be shown if the promise is rejected */
errorContent: PropTypes.node,
/** content to be shown while the promise is in pending state */
loadingContent: PropTypes.node,
/** content to be shown while the promise is in "pending" state (like a loading graphic, perhaps) */
pendingContent: PropTypes.node,
}
static defaultProps = {
contentRenderedFunc: () => {},
convertToJSXFunc: (x) => x,
data: null,
errorContent: '⚠️',
loadingContent: null,
children: <div />,
childrenDidRender: () => {},
pendingContent: <div />,
}

@@ -47,60 +92,63 @@

mounted = false
promise = null
state = {}
convertDataToJSXOrWait(props = this.props) {
const {data} = props;
handlePromiseFulfillment(context, payload) {
if (!this.mounted) { return; }
if (data instanceof Promise) {
this.setState({component: null});
// only set the component if the promise that is fulfilled matches
// the one we're tracking in state, otherwise ignore it and retain the previous data
this.setState(function renderPayloadIfPromiseMatches(state) {
if (this.promise === context) {
this.promise = null;
return data.then((payload) => {
if (this.mounted) {
// only replace if we're looking at the same promise, otherwise do nothing
this.setState((state, currentProps) => ({
component: currentProps.data === data
? currentProps.convertToJSXFunc(payload)
: state.component,
}));
}
}, () => this.setState({component: false}));
return {component: payload};
}
return state;
}, this.fireRenderCallback);
}
handleChildren(children) {
let content = children;
if (React.isValidElement(content)) {
return this.setState({component: content}, this.fireRenderCallback);
} else if (typeof content === 'function') {
return this.handleChildren(content(this.props));
}
this.setState({component: props.convertToJSXFunc(data)});
const boundHandler = this.handlePromiseFulfillment.bind(this, content);
// this is kept outside state so it can be set immediately if the props change
this.promise = content;
this.setState({component: null}, () => content.then(boundHandler, boundHandler));
}
fireCallbackIfDataRendered() {
fireRenderCallback() {
if (this.state.component) {
this.props.contentRenderedFunc();
this.props.childrenDidRender();
}
}
componentWillMount() { this.convertDataToJSXOrWait(); }
componentDidMount() { this.mounted = true; this.fireCallbackIfDataRendered(); }
componentDidUpdate() { this.fireCallbackIfDataRendered(); }
componentWillReceiveProps(nextProps) { this.convertDataToJSXOrWait(nextProps); }
componentWillMount() { this.handleChildren(this.props.children); }
componentDidMount() { this.mounted = true; }
componentWillReceiveProps(nextProps) { this.handleChildren(nextProps.children); }
componentWillUnmount() { this.mounted = false; }
getClasses(extraClasses) {
return cx('b-async', this.props.className, extraClasses, {
'b-async-error': this.state.component === false,
'b-async-loading': this.state.component === null,
});
}
render() {
if (this.state.component === null || this.state.component === false) {
return (
<div {...omit(this.props, Async.internalKeys)} className={this.getClasses()}>
{this.state.component === null
? this.props.loadingContent
: this.props.errorContent}
</div>
);
}
const {props, state} = this;
return React.cloneElement(this.state.component, {
...omit(this.props, Async.internalKeys),
className: this.getClasses(this.state.component.props && this.state.component.props.className),
return React.cloneElement(state.component || props.pendingContent, {
...omit(props, Async.internalKeys),
className: cx(
'b-async',
props.className,
state.component === null && get(props, 'pendingContent.props.className'),
state.component && get(state, 'component.props.className', ''),
{'b-async-pending': state.component === null}
),
});
}
}

@@ -5,7 +5,6 @@ /* eslint no-unused-expressions:0 */

import ReactDOM from 'react-dom';
import {identity} from 'lodash';
import sinon from 'sinon';
import Async from './index';
import conformanceChecker from '../boundless-utils-conformance/index';
import {$, conformanceChecker} from '../boundless-utils-test-helpers/index';

@@ -25,56 +24,48 @@ describe('Async higher-order component', () => {

it('accepts normal renderable content', () => {
render(<Async data={<span className='bar'>foo</span>} />);
expect(document.querySelector('.bar')).not.toBeNull();
render(<Async><span className='bar'>foo</span></Async>);
expect($('.bar')).not.toBeNull();
});
it('calls contentRenderedFunc() upon successful rendering of passed data', () => {
const stub = sandbox.stub();
render(<Async contentRenderedFunc={stub} data={<span className='bar'>foo</span>} />);
expect(stub.calledOnce).toBe(true);
expect(document.querySelector('.bar')).not.toBeNull();
});
describe('promise support', () => {
it('accepts a promise as props.data', () => {
const promise = Promise.resolve(<span className='bar'>foo</span>);
it('renders the promise\'s payload on resolution', () => {
render(
<Async>
{Promise.resolve(<span className='bar'>foo</span>)}
</Async>
);
render(<Async data={promise} />);
return Promise.resolve().then(() => {
expect(document.querySelector('.bar')).not.toBeNull();
expect($('.bar')).not.toBeNull();
});
});
it('displays loading content while the promise is pending', () => {
render(<Async data={new Promise(() => {})} loadingContent='⏲' />);
it('renders the promise\'s payload on rejection', () => {
render(
<Async>
{Promise.reject(<span className='bar'>foo</span>)}
</Async>
);
return Promise.resolve().then(() => {
expect(document.querySelector('.b-async-loading')).not.toBeNull();
expect(document.querySelector('.b-async-loading').textContent).toBe('⏲');
expect($('.bar')).not.toBeNull();
});
});
it('displays error content if the promise rejects', () => {
let rejector;
const promise = new Promise((_, reject) => (rejector = reject));
it('renders pending content if provided until the child promise has been fulfilled', () => {
let resolver;
render(<Async data={promise} errorContent='😞' />);
rejector();
render(
<Async pendingContent={<i className='loading'>⏲</i>}>
{new Promise((resolve) => (resolver = resolve))}
</Async>
);
return Promise.resolve().then(() => {
expect(document.querySelector('.b-async-error')).not.toBeNull();
expect(document.querySelector('.b-async-error').textContent).toBe('😞');
});
});
expect($('.loading')).not.toBeNull();
expect($('.loading').textContent).toBe('⏲');
it('calls convertToJSXFunc when the promise resolves', () => {
const promise = Promise.resolve({children: 'foo', className: 'bar'});
const converter = sandbox.spy((data) => <span {...data} />);
resolver(<span className='bar'>foo</span>);
render(<Async convertToJSXFunc={converter} data={promise} />);
return Promise.resolve().then(() => {
expect(converter.calledOnce).toBe(true);
expect(document.querySelector('.bar')).not.toBeNull();
expect($('.loading')).toBeNull();
expect($('.bar')).not.toBeNull();
});

@@ -86,8 +77,5 @@ });

let resolver2;
const promise1 = new Promise((resolve) => (resolver1 = resolve));
const promise2 = new Promise((resolve) => (resolver2 = resolve));
const converter = sandbox.spy(identity);
render(<Async data={promise1} convertToJSXFunc={converter} />);
render(<Async data={promise2} convertToJSXFunc={converter} />);
render(<Async>{new Promise((resolve) => (resolver1 = resolve))}</Async>);
render(<Async>{new Promise((resolve) => (resolver2 = resolve))}</Async>);

@@ -98,24 +86,68 @@ resolver2(<span className='bar'>foo</span>);

return Promise.resolve().then(() => {
expect(converter.calledOnce).toBe(true);
expect(document.querySelector('.bar')).not.toBeNull();
expect(document.querySelector('.fizz')).toBeNull();
expect($('.bar')).not.toBeNull();
expect($('.fizz')).toBeNull();
});
});
});
it('calls contentRenderedFunc() once the promise has resolved', () => {
let resolver1;
const promise1 = new Promise((resolve) => (resolver1 = resolve));
describe('props.childrenDidRender function', () => {
it('is called when the passed child content is rendered', () => {
const stub = sandbox.stub();
render(<Async contentRenderedFunc={stub} data={promise1} convertToJSXFunc={identity} />);
expect(stub.notCalled).toBe(true);
render(<Async childrenDidRender={stub}><span className='bar'>foo</span></Async>);
expect(stub.calledOnce).toBe(true);
expect($('.bar')).not.toBeNull();
});
resolver1(<span className='fizz'>buzz</span>);
it('is called when a passed child promise is fulfilled and then rendered', () => {
const stub = sandbox.stub();
let resolver;
render(
<Async childrenDidRender={stub}>
{new Promise((resolve) => (resolver = resolve))}
</Async>
);
expect(stub.called).toBe(false);
resolver(<span className='bar'>foo</span>);
return Promise.resolve().then(() => {
expect(stub.calledOnce).toBe(true);
expect(document.querySelector('.fizz')).not.toBeNull();
expect($('.bar')).not.toBeNull();
});
});
it('is called when a passed child function returns JSX, which is rendered immediately', () => {
const stub = sandbox.stub();
render(
<Async childrenDidRender={stub}>
{() => <span className='bar'>foo</span>}
</Async>
);
expect(stub.calledOnce).toBe(true);
expect($('.bar')).not.toBeNull();
});
it('is called when a passed child function returns a promise and that promise is later fulfilled', () => {
const stub = sandbox.stub();
let resolver;
render(
<Async childrenDidRender={stub}>
{() => new Promise((resolve) => (resolver = resolve))}
</Async>
);
expect(stub.called).toBe(false);
resolver(<span className='bar'>foo</span>);
return Promise.resolve().then(() => {
expect(stub.calledOnce).toBe(true);
expect($('.bar')).not.toBeNull();
});
});
});
});
{
"name": "boundless-async",
"version": "1.0.0-beta.6",
"version": "1.0.0-beta.7",
"description": "A higher-order component for rendering data that isn't ready yet.",

@@ -24,3 +24,3 @@ "author": "Evan Scott <glitterbyte@gmail.com> (http://yaycmyk.com) (http://yaycmyk.com)",

"dependencies": {
"boundless-utils-omit-keys": "^1.0.0-beta.6",
"boundless-utils-omit-keys": "^1.0.0-beta.7",
"classnames": "^2.1.5"

@@ -27,0 +27,0 @@ },

@@ -0,4 +1,6 @@

<!---
THIS IS AN AUTOGENERATED FILE. EDIT INDEX.JS INSTEAD.
-->
# Async
# Async
__A higher-order component for rendering data that isn't ready yet.__

@@ -9,60 +11,96 @@

that pattern by handling common types of promises and providing a simple mechanism
for materializing the resolved data into JSX.
for materializing the fulfilled payload into JSX.
## Props
_Note: only top-level props are in the README, for the full list check out the [website](http://boundless.js.org/Async#props)._
> Note: only top-level props are in the README, for the full list check out the [website](http://boundless.js.org/Async#props).
### Required Props
There are no required props.
- __`children`__ ・ a promise, function that returns a promise, or other type of renderable content; if a function is passed, it will
be called with the current props
Promise example:
```jsx
const listDataPromise = fetch('/some/list/data/endpoint').then(
(response) => response.ok ? response.json() : 'Failed to receive list data',
(error) => error.message,
).then((payload) => {
if (typeof payload === 'string') {
return (<div className='error'>{payload}</div>);
}
return (
<ul>
{payload.map((item) => (<li key={item.id}>{item.content}</li>))}
</ul>
);
});
<Async>{listDataPromise}</Async>
Function example:
```jsx
const fetchListData = (props) => fetch(props['data-endpoint']).then(
(response) => response.ok ? response.json() : 'Failed to receive list data',
(error) => error.message,
).then((payload) => {
if (typeof payload === 'string') {
return (<div className='error'>{payload}</div>);
}
return (
<ul>
{payload.map((item) => (<li key={item.id}>{item.content}</li>))}
</ul>
);
});
<Async data-endpoint='/some/list/data/endpoint'>{fetchListData}</Async>
```
Expects | Default Value
- | -
`function or any renderable or Promise` | `<div />`
### Optional Props
<table>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default Value</th>
<th>Description</th>
</tr>
- __`*`__ ・ any [React-supported attribute](https://facebook.github.io/react/docs/tags-and-attributes.html#html-attributes)
<tr>
<td>contentRenderedFunc</td>
<td><pre><code>function</code></pre></td>
<td><pre><code class="language-js">() => {}</code></pre></td>
<td>a callback for when real content has been rendered; either normal passed data or when a passed promise resolves</td>
</tr>
Expects | Default Value
- | -
`any` | `n/a`
<tr>
<td>convertToJSXFunc</td>
<td><pre><code>function</code></pre></td>
<td><pre><code class="language-js">(x) => x</code></pre></td>
<td>a function that takes the resolved payload of a promise provided by `props.data` and returns renderable JSX; defaults to trying to render the resolved value of the Promise</td>
</tr>
- __`childrenDidRender`__ ・ a callback for when real content has been rendered; this will be called immediately if normal JSX is passed to Async, or, in the case of a promise, upon resolution or rejection
<tr>
<td>data</td>
<td><pre><code>any</code></pre></td>
<td><pre><code class="language-js">null</code></pre></td>
<td>a promise, or some other piece of data to be run through `props.convertToJSXFunc`</td>
</tr>
Expects | Default Value
- | -
`function` | `() => {}`
<tr>
<td>errorContent</td>
<td><pre><code>any renderable</code></pre></td>
<td><pre><code class="language-js">'⚠️'</code></pre></td>
<td>content to be shown if the promise is rejected</td>
</tr>
- __`pendingContent`__ ・ content to be shown while the promise is in "pending" state (like a loading graphic, perhaps)
<tr>
<td>loadingContent</td>
<td><pre><code>any renderable</code></pre></td>
<td><pre><code class="language-js">null</code></pre></td>
<td>content to be shown while the promise is in pending state</td>
</tr>
Expects | Default Value
- | -
`any renderable` | `<div />`
</table>
## Reference Styles
### Stylus
```stylus
// Bring in Boundless's base Stylus variables
@require "node_modules/boundless-async/variables"
// Redefine any variables as desired, e.g.
color-accent = royalblue
// Bring in the component styles; they will be autoconfigured based on the above
@require "node_modules/boundless-async/style"
```
### CSS
If desired, a precompiled plain CSS stylesheet is available for customization at `/build/style.css`, based on Boundless's [default variables](https://github.com/enigma-io/boundless/blob/master/variables.styl).

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc