\n))"),t.WithStateDemo)}},"./demo/index.tsx":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("./node_modules/react/index.js"),o=n("./node_modules/react-dom/index.js"),a=n("./node_modules/react-hot-loader/index.js");n("./styles/index.less"),n("./demo/demo.less");var i,l=n("./demo/demos sync recursive \\.*\\.tsx$"),u=document.body;i=function(){return r.createElement("div",null,l.keys().map(function(e){return l(e)}).map(function(e,t){return r.createElement(e.default,{key:t})}))},o.render(r.createElement(a.AppContainer,null,r.createElement("div",{id:"app"},r.createElement(i,null))),u)},"./node_modules/css-loader/index.js??ref--8-1!./node_modules/less-loader/dist/cjs.js??ref--8-2!./demo/demo.less":function(e,t,n){(e.exports=n("./node_modules/css-loader/lib/css-base.js")(!0)).push([e.i,"html,\nbody,\n#app {\n margin: 0;\n height: 100%;\n width: 100%;\n font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;\n}\n#app {\n margin: 0 auto;\n width: 80%;\n}\n.step {\n border: 1px solid #ddd;\n margin-top: 2rem;\n border-radius: 4px;\n}\n.step:last-child {\n margin-bottom: 5rem;\n}\n.step .step-header {\n background-color: #eee;\n margin: 0;\n padding: 0.5rem;\n border-bottom: 1px solid #ddd;\n padding-bottom: 0.5rem;\n}\n.step .step-body {\n padding: 0.5rem;\n padding-top: 0.5rem;\n}\n.step .code-sample {\n font-family: 'Operator Mono', 'Courier New', Courier, monospace;\n padding: 1rem;\n overflow-x: auto;\n background-color: #555;\n color: #fff;\n}\npre {\n font-family: monospace;\n}\n","",{version:3,sources:["/Users/pgray/dev/chainable-components/demo/demo.less","/Users/pgray/dev/chainable-components/demo/demo.less"],names:[],mappings:"AAAA;;;EACE,UAAA;EACA,aAAA;EACA,YAAA;EACA,uHAAA;CCGD;ADAD;EACE,eAAA;EACA,WAAA;CCED;ADCD;EACE,uBAAA;EACA,iBAAA;EACA,mBAAA;CCCD;ADAC;EACE,oBAAA;CCEH;ADPD;EAQI,uBAAA;EACA,UAAA;EACA,gBAAA;EACA,8BAAA;EACA,uBAAA;CCEH;ADdD;EAeI,gBAAA;EACA,oBAAA;CCEH;ADlBD;EAmBI,gEAAA;EACA,cAAA;EACA,iBAAA;EACA,uBAAA;EACA,YAAA;CCEH;ADED;EACE,uBAAA;CCAD",file:"demo.less",sourcesContent:["html, body, #app {\n margin: 0;\n height: 100%;\n width: 100%;\n font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;\n}\n\n#app {\n margin: 0 auto;\n width: 80%;\n}\n\n.step {\n border: 1px solid #ddd;\n margin-top: 2rem;\n border-radius: 4px;\n &:last-child {\n margin-bottom: 5rem;\n }\n .step-header {\n background-color: #eee;\n margin: 0;\n padding: 0.5rem;\n border-bottom: 1px solid #ddd;\n padding-bottom: 0.5rem;\n }\n .step-body {\n padding: 0.5rem;\n padding-top: 0.5rem;\n }\n .code-sample {\n font-family: 'Operator Mono', 'Courier New', Courier, monospace;\n padding: 1rem;\n overflow-x: auto;\n background-color: #555;\n color: #fff; \n }\n}\n\npre {\n font-family: monospace;\n}","html,\nbody,\n#app {\n margin: 0;\n height: 100%;\n width: 100%;\n font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;\n}\n#app {\n margin: 0 auto;\n width: 80%;\n}\n.step {\n border: 1px solid #ddd;\n margin-top: 2rem;\n border-radius: 4px;\n}\n.step:last-child {\n margin-bottom: 5rem;\n}\n.step .step-header {\n background-color: #eee;\n margin: 0;\n padding: 0.5rem;\n border-bottom: 1px solid #ddd;\n padding-bottom: 0.5rem;\n}\n.step .step-body {\n padding: 0.5rem;\n padding-top: 0.5rem;\n}\n.step .code-sample {\n font-family: 'Operator Mono', 'Courier New', Courier, monospace;\n padding: 1rem;\n overflow-x: auto;\n background-color: #555;\n color: #fff;\n}\npre {\n font-family: monospace;\n}\n"],sourceRoot:""}])},"./node_modules/css-loader/index.js??ref--8-1!./node_modules/less-loader/dist/cjs.js??ref--8-2!./styles/index.less":function(e,t,n){(e.exports=n("./node_modules/css-loader/lib/css-base.js")(!0)).push([e.i,"","",{version:3,sources:[],names:[],mappings:"",file:"index.less",sourceRoot:""}])},"./node_modules/css-loader/lib/css-base.js":function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(i=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),a=r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"});return[n].concat(a).concat([o]).join("\n")}var i;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o0&&void 0!==arguments[0]?arguments[0]:{};(0,i.default)(c.canUseDOM,"Browser history needs a DOM");var t=window.history,n=(0,c.supportsHistory)(),f=!(0,c.supportsPopStateOnHashChange)(),p=e.forceRefresh,h=void 0!==p&&p,m=e.getUserConfirmation,v=void 0===m?c.getConfirmation:m,y=e.keyLength,g=void 0===y?6:y,b=e.basename?(0,u.stripTrailingSlash)((0,u.addLeadingSlash)(e.basename)):"",w=function(e){var t=e||{},n=t.key,r=t.state,o=window.location,i=o.pathname+o.search+o.hash;return(0,a.default)(!b||(0,u.hasBasename)(i,b),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+i+'" to begin with "'+b+'".'),b&&(i=(0,u.stripBasename)(i,b)),(0,l.createLocation)(i,r,n)},x=function(){return Math.random().toString(36).substr(2,g)},_=(0,s.default)(),E=function(e){o(D,e),D.length=t.length,_.notifyListeners(D.location,D.action)},C=function(e){(0,c.isExtraneousPopstateEvent)(e)||T(w(e.state))},k=function(){T(w(d()))},S=!1,T=function(e){S?(S=!1,E()):_.confirmTransitionTo(e,"POP",v,function(t){t?E({action:"POP",location:e}):P(e)})},P=function(e){var t=D.location,n=O.indexOf(t.key);-1===n&&(n=0);var r=O.indexOf(e.key);-1===r&&(r=0);var o=n-r;o&&(S=!0,A(o))},j=w(d()),O=[j.key],R=function(e){return b+(0,u.createPath)(e)},A=function(e){t.go(e)},N=0,U=function(e){1===(N+=e)?((0,c.addEventListener)(window,"popstate",C),f&&(0,c.addEventListener)(window,"hashchange",k)):0===N&&((0,c.removeEventListener)(window,"popstate",C),f&&(0,c.removeEventListener)(window,"hashchange",k))},M=!1,D={length:t.length,action:"POP",location:j,createHref:R,push:function(e,o){(0,a.default)(!("object"===(void 0===e?"undefined":r(e))&&void 0!==e.state&&void 0!==o),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var i=(0,l.createLocation)(e,o,x(),D.location);_.confirmTransitionTo(i,"PUSH",v,function(e){if(e){var r=R(i),o=i.key,l=i.state;if(n)if(t.pushState({key:o,state:l},null,r),h)window.location.href=r;else{var u=O.indexOf(D.location.key),s=O.slice(0,-1===u?0:u+1);s.push(i.key),O=s,E({action:"PUSH",location:i})}else(0,a.default)(void 0===l,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=r}})},replace:function(e,o){(0,a.default)(!("object"===(void 0===e?"undefined":r(e))&&void 0!==e.state&&void 0!==o),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var i=(0,l.createLocation)(e,o,x(),D.location);_.confirmTransitionTo(i,"REPLACE",v,function(e){if(e){var r=R(i),o=i.key,l=i.state;if(n)if(t.replaceState({key:o,state:l},null,r),h)window.location.replace(r);else{var u=O.indexOf(D.location.key);-1!==u&&(O[u]=i.key),E({action:"REPLACE",location:i})}else(0,a.default)(void 0===l,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(r)}})},go:A,goBack:function(){return A(-1)},goForward:function(){return A(1)},block:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=_.setPrompt(e);return M||(U(1),M=!0),function(){return M&&(M=!1,U(-1)),t()}},listen:function(e){var t=_.appendListener(e);return U(1),function(){U(-1),t()}}};return D}},"./node_modules/history/createTransitionManager.js":function(e,t,n){"use strict";t.__esModule=!0;var r,o=n("./node_modules/warning/browser.js"),a=(r=o)&&r.__esModule?r:{default:r};t.default=function(){var e=null,t=[];return{setPrompt:function(t){return(0,a.default)(null==e,"A history supports only one prompt at a time"),e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,o):((0,a.default)(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),o(!0)):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0,r=function(){n&&e.apply(void 0,arguments)};return t.push(r),function(){n=!1,t=t.filter(function(e){return e!==r})}},notifyListeners:function(){for(var e=arguments.length,n=Array(e),r=0;rO.length&&O.push(e)}function N(e,t,n,r){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var a=!1;if(null===e)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case u:case s:a=!0}}if(a)return n(r,e,""===t?"."+U(e,0):t),1;if(a=0,t=""===t?".":t+":",Array.isArray(e))for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:"",n=e&&e.split("/")||[],a=t&&t.split("/")||[],i=e&&r(e),l=t&&r(t),u=i||l;if(e&&r(e)?a=n:n.length&&(a.pop(),a=a.concat(n)),!a.length)return"/";var s=void 0;if(a.length){var c=a[a.length-1];s="."===c||".."===c||""===c}else s=!1;for(var f=0,d=a.length;d>=0;d--){var p=a[d];"."===p?o(a,d):".."===p?(o(a,d),f++):f&&(o(a,d),f--)}if(!u)for(;f--;f)a.unshift("..");!u||""===a[0]||a[0]&&r(a[0])||a.unshift("");var h=a.join("/");return s&&"/"!==h.substr(-1)&&(h+="/"),h}},"./node_modules/style-loader/lib/addStyles.js":function(e,t,n){var r,o,a={},i=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),l=function(e){var t={};return function(e){if(void 0===t[e]){var n=function(e){return document.querySelector(e)}.call(this,e);if(n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}}(),u=null,s=0,c=[],f=n("./node_modules/style-loader/lib/urls.js");function d(e,t){for(var n=0;n=0&&c.splice(t,1)}function v(e){var t=document.createElement("style");return e.attrs.type="text/css",y(t,e.attrs),h(e,t),t}function y(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function g(e,t){var n,r,o,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var i=s++;n=u||(u=v(t)),r=x.bind(null,n,i,!1),o=x.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",y(t,e.attrs),h(e,t),t}(t),r=function(e,t,n){var r=n.css,o=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||a)&&(r=f(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var i=new Blob([r],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(i),l&&URL.revokeObjectURL(l)}.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),r=function(e,t){var n=t.css,r=t.media;r&&e.setAttribute("media",r);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){m(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=i()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=p(e,t);return d(n,t),function(e){for(var r=[],o=0;oO.length&&O.push(e)}function N(e,t,n,r){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var a=!1;if(null===e)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case u:case s:a=!0}}if(a)return n(r,e,""===t?"."+U(e,0):t),1;if(a=0,t=""===t?".":t+":",Array.isArray(e))for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:"",n=e&&e.split("/")||[],a=t&&t.split("/")||[],i=e&&r(e),l=t&&r(t),u=i||l;if(e&&r(e)?a=n:n.length&&(a.pop(),a=a.concat(n)),!a.length)return"/";var s=void 0;if(a.length){var c=a[a.length-1];s="."===c||".."===c||""===c}else s=!1;for(var f=0,d=a.length;d>=0;d--){var p=a[d];"."===p?o(a,d):".."===p?(o(a,d),f++):f&&(o(a,d),f--)}if(!u)for(;f--;f)a.unshift("..");!u||""===a[0]||a[0]&&r(a[0])||a.unshift("");var h=a.join("/");return s&&"/"!==h.substr(-1)&&(h+="/"),h}},"./node_modules/style-loader/lib/addStyles.js":function(e,t,n){var r,o,a={},i=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),l=function(e){var t={};return function(e){if(void 0===t[e]){var n=function(e){return document.querySelector(e)}.call(this,e);if(n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}}(),u=null,s=0,c=[],f=n("./node_modules/style-loader/lib/urls.js");function d(e,t){for(var n=0;n=0&&c.splice(t,1)}function v(e){var t=document.createElement("style");return e.attrs.type="text/css",y(t,e.attrs),h(e,t),t}function y(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function g(e,t){var n,r,o,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var i=s++;n=u||(u=v(t)),r=x.bind(null,n,i,!1),o=x.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",y(t,e.attrs),h(e,t),t}(t),r=function(e,t,n){var r=n.css,o=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||a)&&(r=f(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var i=new Blob([r],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(i),l&&URL.revokeObjectURL(l)}.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),r=function(e,t){var n=t.css,r=t.media;r&&e.setAttribute("media",r);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){m(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=i()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=p(e,t);return d(n,t),function(e){for(var r=[],o=0;o (\n
\n {/* a.value is inferred as a string */}\n
a: {a.value}
\n \n {/* b.value through f.value is inferred as a number */}\n
b: {b.value}
\n
c: {c.value}
\n
d: {d.value}
\n
e: {e.value}
\n
f: {f.value}
\n
\n ));\n\nexport default () => (\n \n
\n {`import { withState, all } from 'chainable-components';\n\nall([\n withState({initial: 'string value'}),\n withState({initial: 1}),\n withState({initial: 2}),\n withState({initial: 3}),\n withState({initial: 5}),\n withState({initial: 8})\n])\n.ap(([a, b, c, d, e, f]) => (\n
\n {/* a.value is inferred as a string */}\n
a: {a.value}
\n \n {/* b.value through f.value is inferred as a number */}\n
b: {b.value}
\n
c: {c.value}
\n
d: {d.value}
\n
e: {e.value}
\n
f: {f.value}
\n
\n));`}\n
\n {WithStateDemo}\n \n);\n \n\n","import * as React from 'react';\nimport { fromRenderProp } from '../src/ChainableComponent';\n// how to create a context hoc?\nimport Step from './Step';\nconst { Consumer, Provider } = React.createContext(\"Default Value\");\n\nconst withContext = fromRenderProp(Consumer);\n\nconst DisplayContext =\n withContext({ children: () => 'hmm, this should be necessary' }).ap(\n context => {\n return (\n \n Current context is:\n
\n \n \n);\n","import * as React from 'react';;\nimport { Route, Router } from 'react-router';\nimport { fromRenderProp } from '../src/ChainableComponent';\nimport Step from './Step';\nimport createBrowserHistory from 'history/createBrowserHistory';\n\nconst customHistory = createBrowserHistory();\n\nconst withRoute = fromRenderProp(Route);\n\n// Route doesn't have any required props, so we can just pass the empty object here\nconst ReactRouterDemoInner: React.SFC = () => (\n \n
\n {`import { Route } from 'react-router';\nconst withRoute = fromRenderProp(Route);\n\nwithRoute({}).ap(\n route => {\n return (\n \n Current route is:\n
{route.history.location.pathname}
{/* route's type is automatically inferred. */}\n \n );\n }\n)`}\n