react-diode
Advanced tools
Comparing version 0.5.0-1 to 0.5.0-2
@@ -1,2 +0,2 @@ | ||
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("lodash.find")),r=e(require("react")),n=e(require("object-assign")),o=e(require("hoist-non-react-statics")),i=e(require("deep-extend"));function u(e,t,r){if(r)return t?t(e()):e();try{var n=Promise.resolve(e());return t?n.then(t):n}catch(e){return Promise.reject(e)}}function a(){}var c=function(){this._queryMockEnabled=!1};c.prototype.injectNetworkLayer=function(e){this._injectedNetworkLayer=e},c.prototype.injectQueryMockResolver=function(e){this._queryMockEnabled=!0,this._queryMockResolver=e},c.prototype.sendQueries=function(e,t){var r=this,o=e,i={},u=this._getCurrentNetworkLayer();return this._queryMockEnabled&&(o=e.filter(function(e){var t=r._queryMockResolver[e.type];if(t&&"function"==typeof t){var n=t(e);return!n||(i[e.type]=n,!1)}return!0})),u.sendQueries(o,t).then(function(e){return n(i,e)})},c.prototype._getCurrentNetworkLayer=function(){return this._injectedNetworkLayer};var p=function(e){this._variables={},this._containerQuery=e};function s(e,t){return Object.assign({},{type:e.type,fragment:e.fragment,resolve:e.resolve},t)}function f(e,t){return e.map(function(e){return function e(t,r){var n=t.callback,o=t.dependencies,i=o.map(function(e){return r[e.type]}).filter(function(e){return Boolean(e)});if(i.length===o.length){var u=s(t,n.apply(void 0,i));return u.dependencies?e(u,r):u}return t}(e,t)})}p.prototype.getContainerQuery=function(){return this._containerQuery},p.prototype.setVariables=function(e){i(this._variables,e)},p.prototype.getVariables=function(){return this._variables},p.prototype.compile=function(){var e=this,t=this._containerQuery.getQueryTypeMap();return Object.keys(t).map(function(r){var n=t[r];return n.fragment=e._compileFragmentKeys(n.fragmentStructure),n.params=e._compileFragmentKeys(n.paramsStructure),n})},p.prototype._compileFragmentKeys=function(e){var t=this;return Object.keys(e).reduce(function(r,n){var o=t._compileFragmentValue(n);return r[o]="object"==typeof e[n]&&null!==e[n]?t._compileFragmentKeys(e[n]):t._compileFragmentValue(e[n]),r},{})},p.prototype._compileFragmentValue=function(e){if("string"==typeof e&&"$"===e.charAt(0)){var t=e.slice(1),r=this._variables[t];return null==r?e:r}return e};var y={BATCH:"batch-query"};function h(e,r,o,i){return Object.keys(o).reduce(function(u,a){var c=o[a],p=t(e,{type:a});if(a===y.BATCH){var s=function(e,r,o){var i={};for(var u in e)if(e.hasOwnProperty(u)){var a=e[u],c=t(r,{type:u});"__additional"===u?n(i,{__additional:a}):a&&c&&(i[u]=(0,c.resolve)(a,c.fragment,o))}return i}(p.resolve(c,i),r,i);Object.assign(u,s)}else u[a]=p.resolve(c,p.fragment,i);return u},{})}function l(e,r,n){var o=[],i=r.queryTypes,u=r.forceMerge,a=i.map(function(r){return t(e,{type:r})}).filter(function(e){return Boolean(e)});if(a.length===i.length||u&&a.length>0){var c=function(e,t,r){return Object.assign({},{type:e.type,resolve:e.resolve},e.request(t,r))}(r,a,n);o.push(c)}else o=o.concat(a);var p=e.filter(function(e){return-1===a.indexOf(e)});return o=o.concat(p)}function v(e,t){return t.forEach(function(t){Object.keys(t.fragment).forEach(function(r){var n=e[t.type][r];0===Object.keys(t.fragment[r]).length&&n&&(n[g]=!0)})}),e}var d=function(){this._batchQueriesEnabled=!1,this._networkLayer=new c};d.prototype.injectNetworkLayer=function(e){this._networkLayer.injectNetworkLayer(e)},d.prototype.useMockQueries=function(e){this._networkLayer.injectQueryMockResolver(e)},d.prototype.useBatchQuery=function(e){e&&(this._batchQueryEnabled=!0,this._batchQuery=e)},d.prototype.forceFetch=function(e,t){var r=function(e,t){return e.query.compile().map(function(e){var r=e.request(e.fragment,e.params,t);return s(e,r)})}(e,t);return this._fetchQueries(r,t).then(function(t){return v(function(e,t){var r=t.query.getContainerQuery().map,o=Object.keys(r).reduce(function(t,n){return t[n]=e[r[n].type],t},{}),i=e.__additional;return i?n(o,{__additional:i}):o}(t,e),r)})},d.prototype.filterCachedFragments=function(e){var t=this.cache[e.type];if(!t)return e;var r={};return Object.keys(e.fragment).forEach(function(n){var o=t[n],i=e.fragment[n],u=Object.keys(i);0!==u.length?(r[n]={},u.forEach(function(e){o&&o[e]||(r[n][e]=i[e])})):o&&!o[g]&&(r[n]={})}),Object.assign({},e,{fragment:r})},d.prototype.fetch=function(e,t){var r=this;return u(function(){var n=new p(e).compile().map(function(e){var n=r.filterCachedFragments(e),o=n.fragment,i=n.params;if(0===Object.keys(o).length)return null;var u=e.request(o,i,t);return s(e,u)}).filter(Boolean);return Promise.resolve(r._fetchQueries(n,t)).then(function(e){i(r.cache,v(e,n))})})},d.prototype._fetchQueries=function(e,t){var r=this;void 0===t&&(t={});var n=e.filter(function(e){return e.dependencies}),o=e.filter(function(e){return!e.dependencies}),i=o;return this._batchQueryEnabled&&(i=l(i,this._batchQuery,t)),this._networkLayer.sendQueries(i,t).then(function(e){var u=h(i,o,e,t);if(n.length>0){var a=f(n,u);return r._fetchQueries(a,t).then(function(e){return Object.assign(u,e)})}return u})};var m=new d,_=r.createContext(null),g="__fac__",b=function(e,t){m.cache=e,m.options=t};b.prototype.getContents=function(){return m.cache},b.prototype.getUnresolvedQueries=function(e){return Object.keys(e.map).filter(function(t){var r=m.cache[t];if(!r)return!0;var n=e.map[t];return Object.keys(n.fragmentStructure).some(function(e){var t=r[e],o=Object.keys(n.fragmentStructure[e]);return 0===o.length?t&&"object"==typeof t?!t[g]:void 0===t:o.some(function(e){return t?void 0===t[e]:void 0===t})})})},b.prototype.hasResolved=function(e){return 0===this.getUnresolvedQueries(e).length},b.prototype.resolve=function(e){return u(function(){return Promise.resolve(m.fetch(e)).then(function(){})})};var q=function(e,t,r){this.map={},this._queryTypeMap={},this._componentName=e,this._queries=t,this._children=r||[],this._parseQueryTypeMap(t),this._mergeChildQueryTypeMap(r),this._buildFinalQueryMap(t,r)};q.prototype.getQueryTypeMap=function(){return this._queryTypeMap},q.prototype.injectChildren=function(e){this._children=this._children.concat(e),this._mergeChildQueryTypeMap(e),this._buildFinalQueryMap(this._queries,this._children)},q.prototype._parseQueryTypeMap=function(e){var t=this;null!=e&&Object.keys(e).forEach(function(r){var n=e[r],o=t._queryTypeMap[n.type];if(o){i(o.fragmentStructure,n.fragmentStructure),i(o.params,n.params)}else{if(!n.type)throw new Error("Invalid query type in query key "+r+" at component "+t._componentName);t._queryTypeMap[n.type]=n}})},q.prototype._mergeChildQueryTypeMap=function(e){var t=this;e&&e.length&&e.forEach(function(e){var r=e.query.map;null!=r&&Object.keys(r).forEach(function(e){var n=r[e],o=t._queryTypeMap[n.type];o?i(o.fragmentStructure,n.fragmentStructure):t._queryTypeMap[n.type]=n})})},q.prototype._buildFinalQueryMap=function(e,t){var r=this;e&&(this.map=Object.keys(e).reduce(function(t,n){return t[n]=r._queryTypeMap[e[n].type],t},{})),t&&t.length&&t.forEach(function(e){var t=e.query.map;Object.keys(t).forEach(function(n){var o=t[n],i=r.map[n];if(i&&i.type!==o.type)return console.warn("Different query type for same query key %s: %s (%s) and %s (%s)",n,r._componentName,i.type,e.componentName,o.type);r.map[n]=r._queryTypeMap[o.type]})})};var k=function(e){function t(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];e.apply(this,t),this.state={error:null,loading:!0}}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.componentDidMount=function(){var e=this;return u(function(){var t=e.props,r=t.cache,n=t.query;if(!r.hasResolved(n))return function(e){if(e&&e.then)return e.then(a)}(function(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(function(){return Promise.resolve(r.resolve(n)).then(function(){e.setState({loading:!1})})},function(t){console.error("error",t),e.setState({error:t,loading:!1})}))})},t.prototype.render=function(){var e=this.props,t=e.Component,n=e.wrapper,o=e.cache,i=e.query,u=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&(r[n]=e[n]);return r}(e,["Component","wrapper","cache","query"]);if(null!==this.state.error)return r.createElement("span",null,this.state.error.message);var a=!o.hasResolved(i)&&this.state.loading?null:r.createElement(t,Object.assign({},u,o.getContents()));return n?r.createElement("div",n,a):a},t}(r.Component);function j(e,t){void 0===t&&(t={});var u,a=e.displayName||e.name,c="Diode("+a+")",p=new q(a,t.queries,t.children);function s(n){return u||(u=function(e,t,n){var i="Diode("+(e.displayName||e.name)+")",u=function(o){function i(e){o.call(this,e),this.wrapperInfo=t.wrapperInfo}return o&&(i.__proto__=o),(i.prototype=Object.create(o&&o.prototype)).constructor=i,i.prototype.render=function(){var t=this,o=this.props,i=o.wrapperInfo?o.wrapperInfo:this.wrapperInfo;return r.createElement(_.Consumer,null,function(o){return r.createElement(k,Object.assign({},t.props,{Component:e,wrapper:i,query:n,cache:o}))})},i}(r.Component);return u.displayName=i,o(u,e)}(e,t,p)),new u(n)}return s.setWrapperInfo=function(e){n(t.wrapperInfo,e)},s.getWrapperInfo=function(e){return t.wrapperInfo[e]},s.getComponent=function(){return e},s.getChildren=function(){return t.children&&t.children.length?t.children:[]},s.query=i(p,e.query),s.displayName=c,s.componentName=a,o(s,e,{query:!0})}var w={Store:m,CacheProvider:_.Provider,QueryTypes:y,createCache:function(e,t){return new b(e,t)},createContainer:j,createRootContainer:function(e,t){var r=j(e,t);return r.query=new p(r.query),r},createQuery:function(e,t,r){if(void 0===r&&(r={}),"string"!=typeof e.type)throw new TypeError("Expected query definition to have query type");if("function"!=typeof e.request)throw new TypeError("Expected query definition to have .request() method");if("function"!=typeof e.resolve)throw new TypeError("Expected query definition to have .resolve() method");var n=Object.create(e);return n.fragmentStructure=t,n.paramsStructure=r,n},queryRequest:function(e,t,r,n){return void 0===n&&(n={}),{pending:!1,url:e,method:t,payload:r,headers:n}},waitForQuery:function(e,t){return e instanceof Array||(e=[e]),{pending:!0,dependencies:e,callback:t}},useBatchQuery:m.useBatchQuery.bind(m),useMockQueries:m.useMockQueries.bind(m),injectNetworkLayer:m.injectNetworkLayer.bind(m)};module.exports=w; | ||
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("lodash.find")),r=e(require("react")),n=e(require("object-assign")),o=e(require("hoist-non-react-statics")),i=e(require("deep-extend"));function u(e,t,r){if(r)return t?t(e()):e();try{var n=Promise.resolve(e());return t?n.then(t):n}catch(e){return Promise.reject(e)}}function a(){}var c=function(){this._queryMockEnabled=!1};c.prototype.injectNetworkLayer=function(e){this._injectedNetworkLayer=e},c.prototype.injectQueryMockResolver=function(e){this._queryMockEnabled=!0,this._queryMockResolver=e},c.prototype.sendQueries=function(e,t){var r=this,o=e,i={},u=this._getCurrentNetworkLayer();return this._queryMockEnabled&&(o=e.filter(function(e){var t=r._queryMockResolver[e.type];if(t&&"function"==typeof t){var n=t(e);return!n||(i[e.type]=n,!1)}return!0})),u.sendQueries(o,t).then(function(e){return n(i,e)})},c.prototype._getCurrentNetworkLayer=function(){return this._injectedNetworkLayer};var p=function(e){this._variables={},this._containerQuery=e};function s(e,t){return Object.assign({},{type:e.type,fragment:e.fragment,resolve:e.resolve},t)}function f(e,t){return e.map(function(e){return function e(t,r){var n=t.callback,o=t.dependencies,i=o.map(function(e){return r[e.type]}).filter(function(e){return Boolean(e)});if(i.length===o.length){var u=s(t,n.apply(void 0,i));return u.dependencies?e(u,r):u}return t}(e,t)})}p.prototype.getContainerQuery=function(){return this._containerQuery},p.prototype.setVariables=function(e){i(this._variables,e)},p.prototype.getVariables=function(){return this._variables},p.prototype.compile=function(){var e=this,t=this._containerQuery.getQueryTypeMap();return Object.keys(t).map(function(r){var n=t[r];return n.fragment=e._compileFragmentKeys(n.fragmentStructure),n.params=e._compileFragmentKeys(n.paramsStructure),n})},p.prototype._compileFragmentKeys=function(e){var t=this;return Object.keys(e).reduce(function(r,n){var o=t._compileFragmentValue(n);return r[o]="object"==typeof e[n]&&null!==e[n]?t._compileFragmentKeys(e[n]):t._compileFragmentValue(e[n]),r},{})},p.prototype._compileFragmentValue=function(e){if("string"==typeof e&&"$"===e.charAt(0)){var t=e.slice(1),r=this._variables[t];return null==r?e:r}return e};var y={BATCH:"batch-query"};function h(e,r,o,i){return Object.keys(o).reduce(function(u,a){var c=o[a],p=t(e,{type:a});if(a===y.BATCH){var s=function(e,r,o){var i={};for(var u in e)if(e.hasOwnProperty(u)){var a=e[u],c=t(r,{type:u});"__additional"===u?n(i,{__additional:a}):a&&c&&(i[u]=(0,c.resolve)(a,c.fragment,o))}return i}(p.resolve(c,i),r,i);Object.assign(u,s)}else u[a]=p.resolve(c,p.fragment,i);return u},{})}function l(e,r,n){var o=[],i=r.queryTypes,u=r.forceMerge,a=i.map(function(r){return t(e,{type:r})}).filter(function(e){return Boolean(e)});if(a.length===i.length||u&&a.length>0){var c=function(e,t,r){return Object.assign({},{type:e.type,resolve:e.resolve},e.request(t,r))}(r,a,n);o.push(c)}else o=o.concat(a);var p=e.filter(function(e){return-1===a.indexOf(e)});return o=o.concat(p)}function v(e,t){return t.forEach(function(t){Object.keys(t.fragment).forEach(function(r){var n=e[t.type][r];0===Object.keys(t.fragment[r]).length&&n&&(n[g]=!0)})}),e}var d=function(){this._batchQueriesEnabled=!1,this._networkLayer=new c};d.prototype.injectNetworkLayer=function(e){this._networkLayer.injectNetworkLayer(e)},d.prototype.useMockQueries=function(e){this._networkLayer.injectQueryMockResolver(e)},d.prototype.useBatchQuery=function(e){e&&(this._batchQueryEnabled=!0,this._batchQuery=e)},d.prototype.forceFetch=function(e,t){var r=function(e,t){return e.query.compile().map(function(e){var r=e.request(e.fragment,e.params,t);return s(e,r)})}(e,t);return this._fetchQueries(r,t).then(function(t){return v(function(e,t){var r=t.query.getContainerQuery().map,o=Object.keys(r).reduce(function(t,n){return t[n]=e[r[n].type],t},{}),i=e.__additional;return i?n(o,{__additional:i}):o}(t,e),r)})},d.prototype.filterCachedFragments=function(e){var t=this.cache[e.type];if(!t)return e;var r={};return Object.keys(e.fragment).forEach(function(n){var o=t[n],i=e.fragment[n],u=Object.keys(i);0!==u.length?(r[n]={},u.forEach(function(e){o&&o[e]||(r[n][e]=i[e])})):o&&!o[g]&&(r[n]={})}),Object.assign({},e,{fragment:r})},d.prototype.fetch=function(e,t){var r=this;return u(function(){var n=new p(e).compile().map(function(e){var n=r.filterCachedFragments(e),o=n.fragment,i=n.params;if(0===Object.keys(o).length)return null;var u=e.request(o,i,t);return s(e,u)}).filter(Boolean);return Promise.resolve(r._fetchQueries(n,t)).then(function(e){i(r.cache,v(e,n))})})},d.prototype._fetchQueries=function(e,t){var r=this;void 0===t&&(t={});var n=e.filter(function(e){return e.dependencies}),o=e.filter(function(e){return!e.dependencies}),i=o;return this._batchQueryEnabled&&(i=l(i,this._batchQuery,t)),this._networkLayer.sendQueries(i,t).then(function(e){var u=h(i,o,e,t);if(n.length>0){var a=f(n,u);return r._fetchQueries(a,t).then(function(e){return Object.assign(u,e)})}return u})};var m=new d,_=r.createContext(null),g="__fac__",b=function(e,t){this.options=t,m.cache=e};b.prototype.getContents=function(){return m.cache},b.prototype.getUnresolvedQueries=function(e){return Object.keys(e.map).filter(function(t){var r=m.cache[t];if(!r)return!0;var n=e.map[t];return Object.keys(n.fragmentStructure).some(function(e){var t=r[e],o=Object.keys(n.fragmentStructure[e]);return 0===o.length?t&&"object"==typeof t?!t[g]:void 0===t:o.some(function(e){return t?void 0===t[e]:void 0===t})})})},b.prototype.hasResolved=function(e){return 0===this.getUnresolvedQueries(e).length},b.prototype.resolve=function(e){var t=this;return u(function(){return Promise.resolve(m.fetch(e,t.options)).then(function(){})})};var q=function(e,t,r){this.map={},this._queryTypeMap={},this._componentName=e,this._queries=t,this._children=r||[],this._parseQueryTypeMap(t),this._mergeChildQueryTypeMap(r),this._buildFinalQueryMap(t,r)};q.prototype.getQueryTypeMap=function(){return this._queryTypeMap},q.prototype.injectChildren=function(e){this._children=this._children.concat(e),this._mergeChildQueryTypeMap(e),this._buildFinalQueryMap(this._queries,this._children)},q.prototype._parseQueryTypeMap=function(e){var t=this;null!=e&&Object.keys(e).forEach(function(r){var n=e[r],o=t._queryTypeMap[n.type];if(o){i(o.fragmentStructure,n.fragmentStructure),i(o.params,n.params)}else{if(!n.type)throw new Error("Invalid query type in query key "+r+" at component "+t._componentName);t._queryTypeMap[n.type]=n}})},q.prototype._mergeChildQueryTypeMap=function(e){var t=this;e&&e.length&&e.forEach(function(e){var r=e.query.map;null!=r&&Object.keys(r).forEach(function(e){var n=r[e],o=t._queryTypeMap[n.type];o?i(o.fragmentStructure,n.fragmentStructure):t._queryTypeMap[n.type]=n})})},q.prototype._buildFinalQueryMap=function(e,t){var r=this;e&&(this.map=Object.keys(e).reduce(function(t,n){return t[n]=r._queryTypeMap[e[n].type],t},{})),t&&t.length&&t.forEach(function(e){var t=e.query.map;Object.keys(t).forEach(function(n){var o=t[n],i=r.map[n];if(i&&i.type!==o.type)return console.warn("Different query type for same query key %s: %s (%s) and %s (%s)",n,r._componentName,i.type,e.componentName,o.type);r.map[n]=r._queryTypeMap[o.type]})})};var k=function(e){function t(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];e.apply(this,t),this.state={error:null,loading:!0}}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.componentDidMount=function(){var e=this;return u(function(){var t=e.props,r=t.cache,n=t.query;if(!r.hasResolved(n))return function(e){if(e&&e.then)return e.then(a)}(function(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(function(){return Promise.resolve(r.resolve(n)).then(function(){e.setState({loading:!1})})},function(t){console.error("error",t),e.setState({error:t,loading:!1})}))})},t.prototype.render=function(){var e=this.props,t=e.Component,n=e.wrapper,o=e.cache,i=e.query,u=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&(r[n]=e[n]);return r}(e,["Component","wrapper","cache","query"]);if(null!==this.state.error)return r.createElement("span",null,this.state.error.message);var a=!o.hasResolved(i)&&this.state.loading?null:r.createElement(t,Object.assign({},u,o.getContents()));return n?r.createElement("div",n,a):a},t}(r.Component);function j(e,t){void 0===t&&(t={});var u,a=e.displayName||e.name,c="Diode("+a+")",p=new q(a,t.queries,t.children);function s(n){return u||(u=function(e,t,n){var i="Diode("+(e.displayName||e.name)+")",u=function(o){function i(e){o.call(this,e),this.wrapperInfo=t.wrapperInfo}return o&&(i.__proto__=o),(i.prototype=Object.create(o&&o.prototype)).constructor=i,i.prototype.render=function(){var t=this,o=this.props,i=o.wrapperInfo?o.wrapperInfo:this.wrapperInfo;return r.createElement(_.Consumer,null,function(o){return r.createElement(k,Object.assign({},t.props,{Component:e,wrapper:i,query:n,cache:o}))})},i}(r.Component);return u.displayName=i,o(u,e)}(e,t,p)),new u(n)}return s.setWrapperInfo=function(e){n(t.wrapperInfo,e)},s.getWrapperInfo=function(e){return t.wrapperInfo[e]},s.getComponent=function(){return e},s.getChildren=function(){return t.children&&t.children.length?t.children:[]},s.query=i(p,e.query),s.displayName=c,s.componentName=a,o(s,e,{query:!0})}var w={Store:m,CacheProvider:_.Provider,QueryTypes:y,createCache:function(e,t){return new b(e,t)},createContainer:j,createRootContainer:function(e,t){var r=j(e,t);return r.query=new p(r.query),r},createQuery:function(e,t,r){if(void 0===r&&(r={}),"string"!=typeof e.type)throw new TypeError("Expected query definition to have query type");if("function"!=typeof e.request)throw new TypeError("Expected query definition to have .request() method");if("function"!=typeof e.resolve)throw new TypeError("Expected query definition to have .resolve() method");var n=Object.create(e);return n.fragmentStructure=t,n.paramsStructure=r,n},queryRequest:function(e,t,r,n){return void 0===n&&(n={}),{pending:!1,url:e,method:t,payload:r,headers:n}},waitForQuery:function(e,t){return e instanceof Array||(e=[e]),{pending:!0,dependencies:e,callback:t}},useBatchQuery:m.useBatchQuery.bind(m),useMockQueries:m.useMockQueries.bind(m),injectNetworkLayer:m.injectNetworkLayer.bind(m)};module.exports=w; | ||
//# sourceMappingURL=DiodePublic.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("lodash.find"),require("react"),require("object-assign"),require("hoist-non-react-statics"),require("deep-extend")):"function"==typeof define&&define.amd?define(["lodash.find","react","object-assign","hoist-non-react-statics","deep-extend"],t):e.reactDiode=t(e.find,e.react,e.objectAssign,e.hoistStatics,e.deepExtend)}(this,function(e,t,r,n,o){function i(e,t,r){if(r)return t?t(e()):e();try{var n=Promise.resolve(e());return t?n.then(t):n}catch(e){return Promise.reject(e)}}function u(){}e=e&&e.hasOwnProperty("default")?e.default:e,t=t&&t.hasOwnProperty("default")?t.default:t,r=r&&r.hasOwnProperty("default")?r.default:r,n=n&&n.hasOwnProperty("default")?n.default:n,o=o&&o.hasOwnProperty("default")?o.default:o;var a=function(){this._queryMockEnabled=!1};a.prototype.injectNetworkLayer=function(e){this._injectedNetworkLayer=e},a.prototype.injectQueryMockResolver=function(e){this._queryMockEnabled=!0,this._queryMockResolver=e},a.prototype.sendQueries=function(e,t){var n=this,o=e,i={},u=this._getCurrentNetworkLayer();return this._queryMockEnabled&&(o=e.filter(function(e){var t=n._queryMockResolver[e.type];if(t&&"function"==typeof t){var r=t(e);return!r||(i[e.type]=r,!1)}return!0})),u.sendQueries(o,t).then(function(e){return r(i,e)})},a.prototype._getCurrentNetworkLayer=function(){return this._injectedNetworkLayer};var c=function(e){this._variables={},this._containerQuery=e};function p(e,t){return Object.assign({},{type:e.type,fragment:e.fragment,resolve:e.resolve},t)}function s(e,t){return e.map(function(e){return function e(t,r){var n=t.callback,o=t.dependencies,i=o.map(function(e){return r[e.type]}).filter(function(e){return Boolean(e)});if(i.length===o.length){var u=p(t,n.apply(void 0,i));return u.dependencies?e(u,r):u}return t}(e,t)})}c.prototype.getContainerQuery=function(){return this._containerQuery},c.prototype.setVariables=function(e){o(this._variables,e)},c.prototype.getVariables=function(){return this._variables},c.prototype.compile=function(){var e=this,t=this._containerQuery.getQueryTypeMap();return Object.keys(t).map(function(r){var n=t[r];return n.fragment=e._compileFragmentKeys(n.fragmentStructure),n.params=e._compileFragmentKeys(n.paramsStructure),n})},c.prototype._compileFragmentKeys=function(e){var t=this;return Object.keys(e).reduce(function(r,n){var o=t._compileFragmentValue(n);return r[o]="object"==typeof e[n]&&null!==e[n]?t._compileFragmentKeys(e[n]):t._compileFragmentValue(e[n]),r},{})},c.prototype._compileFragmentValue=function(e){if("string"==typeof e&&"$"===e.charAt(0)){var t=e.slice(1),r=this._variables[t];return null==r?e:r}return e};var f={BATCH:"batch-query"};function y(t,n,o,i){return Object.keys(o).reduce(function(u,a){var c=o[a],p=e(t,{type:a});if(a===f.BATCH){var s=function(t,n,o){var i={};for(var u in t)if(t.hasOwnProperty(u)){var a=t[u],c=e(n,{type:u});"__additional"===u?r(i,{__additional:a}):a&&c&&(i[u]=(0,c.resolve)(a,c.fragment,o))}return i}(p.resolve(c,i),n,i);Object.assign(u,s)}else u[a]=p.resolve(c,p.fragment,i);return u},{})}function h(t,r,n){var o=[],i=r.queryTypes,u=r.forceMerge,a=i.map(function(r){return e(t,{type:r})}).filter(function(e){return Boolean(e)});if(a.length===i.length||u&&a.length>0){var c=function(e,t,r){return Object.assign({},{type:e.type,resolve:e.resolve},e.request(t,r))}(r,a,n);o.push(c)}else o=o.concat(a);var p=t.filter(function(e){return-1===a.indexOf(e)});return o=o.concat(p)}function l(e,t){return t.forEach(function(t){Object.keys(t.fragment).forEach(function(r){var n=e[t.type][r];0===Object.keys(t.fragment[r]).length&&n&&(n[g]=!0)})}),e}var d=function(){this._batchQueriesEnabled=!1,this._networkLayer=new a};d.prototype.injectNetworkLayer=function(e){this._networkLayer.injectNetworkLayer(e)},d.prototype.useMockQueries=function(e){this._networkLayer.injectQueryMockResolver(e)},d.prototype.useBatchQuery=function(e){e&&(this._batchQueryEnabled=!0,this._batchQuery=e)},d.prototype.forceFetch=function(e,t){var n=function(e,t){return e.query.compile().map(function(e){var r=e.request(e.fragment,e.params,t);return p(e,r)})}(e,t);return this._fetchQueries(n,t).then(function(t){return l(function(e,t){var n=t.query.getContainerQuery().map,o=Object.keys(n).reduce(function(t,r){return t[r]=e[n[r].type],t},{}),i=e.__additional;return i?r(o,{__additional:i}):o}(t,e),n)})},d.prototype.filterCachedFragments=function(e){var t=this.cache[e.type];if(!t)return e;var r={};return Object.keys(e.fragment).forEach(function(n){var o=t[n],i=e.fragment[n],u=Object.keys(i);0!==u.length?(r[n]={},u.forEach(function(e){o&&o[e]||(r[n][e]=i[e])})):o&&!o[g]&&(r[n]={})}),Object.assign({},e,{fragment:r})},d.prototype.fetch=function(e,t){var r=this;return i(function(){var n=new c(e).compile().map(function(e){var n=r.filterCachedFragments(e),o=n.fragment,i=n.params;if(0===Object.keys(o).length)return null;var u=e.request(o,i,t);return p(e,u)}).filter(Boolean);return Promise.resolve(r._fetchQueries(n,t)).then(function(e){o(r.cache,l(e,n))})})},d.prototype._fetchQueries=function(e,t){var r=this;void 0===t&&(t={});var n=e.filter(function(e){return e.dependencies}),o=e.filter(function(e){return!e.dependencies}),i=o;return this._batchQueryEnabled&&(i=h(i,this._batchQuery,t)),this._networkLayer.sendQueries(i,t).then(function(e){var u=y(i,o,e,t);if(n.length>0){var a=s(n,u);return r._fetchQueries(a,t).then(function(e){return Object.assign(u,e)})}return u})};var m=new d,v=t.createContext(null),g="__fac__",_=function(e,t){m.cache=e,m.options=t};_.prototype.getContents=function(){return m.cache},_.prototype.getUnresolvedQueries=function(e){return Object.keys(e.map).filter(function(t){var r=m.cache[t];if(!r)return!0;var n=e.map[t];return Object.keys(n.fragmentStructure).some(function(e){var t=r[e],o=Object.keys(n.fragmentStructure[e]);return 0===o.length?t&&"object"==typeof t?!t[g]:void 0===t:o.some(function(e){return t?void 0===t[e]:void 0===t})})})},_.prototype.hasResolved=function(e){return 0===this.getUnresolvedQueries(e).length},_.prototype.resolve=function(e){return i(function(){return Promise.resolve(m.fetch(e)).then(function(){})})};var b=function(e,t,r){this.map={},this._queryTypeMap={},this._componentName=e,this._queries=t,this._children=r||[],this._parseQueryTypeMap(t),this._mergeChildQueryTypeMap(r),this._buildFinalQueryMap(t,r)};b.prototype.getQueryTypeMap=function(){return this._queryTypeMap},b.prototype.injectChildren=function(e){this._children=this._children.concat(e),this._mergeChildQueryTypeMap(e),this._buildFinalQueryMap(this._queries,this._children)},b.prototype._parseQueryTypeMap=function(e){var t=this;null!=e&&Object.keys(e).forEach(function(r){var n=e[r],i=t._queryTypeMap[n.type];if(i){o(i.fragmentStructure,n.fragmentStructure),o(i.params,n.params)}else{if(!n.type)throw new Error("Invalid query type in query key "+r+" at component "+t._componentName);t._queryTypeMap[n.type]=n}})},b.prototype._mergeChildQueryTypeMap=function(e){var t=this;e&&e.length&&e.forEach(function(e){var r=e.query.map;null!=r&&Object.keys(r).forEach(function(e){var n=r[e],i=t._queryTypeMap[n.type];i?o(i.fragmentStructure,n.fragmentStructure):t._queryTypeMap[n.type]=n})})},b.prototype._buildFinalQueryMap=function(e,t){var r=this;e&&(this.map=Object.keys(e).reduce(function(t,n){return t[n]=r._queryTypeMap[e[n].type],t},{})),t&&t.length&&t.forEach(function(e){var t=e.query.map;Object.keys(t).forEach(function(n){var o=t[n],i=r.map[n];if(i&&i.type!==o.type)return console.warn("Different query type for same query key %s: %s (%s) and %s (%s)",n,r._componentName,i.type,e.componentName,o.type);r.map[n]=r._queryTypeMap[o.type]})})};var q=function(e){function r(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];e.apply(this,t),this.state={error:null,loading:!0}}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.componentDidMount=function(){var e=this;return i(function(){var t=e.props,r=t.cache,n=t.query;if(!r.hasResolved(n))return function(e){if(e&&e.then)return e.then(u)}(function(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(function(){return Promise.resolve(r.resolve(n)).then(function(){e.setState({loading:!1})})},function(t){console.error("error",t),e.setState({error:t,loading:!1})}))})},r.prototype.render=function(){var e=this.props,r=e.Component,n=e.wrapper,o=e.cache,i=e.query,u=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&(r[n]=e[n]);return r}(e,["Component","wrapper","cache","query"]);if(null!==this.state.error)return t.createElement("span",null,this.state.error.message);var a=!o.hasResolved(i)&&this.state.loading?null:t.createElement(r,Object.assign({},u,o.getContents()));return n?t.createElement("div",n,a):a},r}(t.Component);function w(e,i){void 0===i&&(i={});var u,a=e.displayName||e.name,c="Diode("+a+")",p=new b(a,i.queries,i.children);function s(r){return u||(u=function(e,r,o){var i="Diode("+(e.displayName||e.name)+")",u=function(n){function i(e){n.call(this,e),this.wrapperInfo=r.wrapperInfo}return n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i,i.prototype.render=function(){var r=this,n=this.props,i=n.wrapperInfo?n.wrapperInfo:this.wrapperInfo;return t.createElement(v.Consumer,null,function(n){return t.createElement(q,Object.assign({},r.props,{Component:e,wrapper:i,query:o,cache:n}))})},i}(t.Component);return u.displayName=i,n(u,e)}(e,i,p)),new u(r)}return s.setWrapperInfo=function(e){r(i.wrapperInfo,e)},s.getWrapperInfo=function(e){return i.wrapperInfo[e]},s.getComponent=function(){return e},s.getChildren=function(){return i.children&&i.children.length?i.children:[]},s.query=o(p,e.query),s.displayName=c,s.componentName=a,n(s,e,{query:!0})}return{Store:m,CacheProvider:v.Provider,QueryTypes:f,createCache:function(e,t){return new _(e,t)},createContainer:w,createRootContainer:function(e,t){var r=w(e,t);return r.query=new c(r.query),r},createQuery:function(e,t,r){if(void 0===r&&(r={}),"string"!=typeof e.type)throw new TypeError("Expected query definition to have query type");if("function"!=typeof e.request)throw new TypeError("Expected query definition to have .request() method");if("function"!=typeof e.resolve)throw new TypeError("Expected query definition to have .resolve() method");var n=Object.create(e);return n.fragmentStructure=t,n.paramsStructure=r,n},queryRequest:function(e,t,r,n){return void 0===n&&(n={}),{pending:!1,url:e,method:t,payload:r,headers:n}},waitForQuery:function(e,t){return e instanceof Array||(e=[e]),{pending:!0,dependencies:e,callback:t}},useBatchQuery:m.useBatchQuery.bind(m),useMockQueries:m.useMockQueries.bind(m),injectNetworkLayer:m.injectNetworkLayer.bind(m)}}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("lodash.find"),require("react"),require("object-assign"),require("hoist-non-react-statics"),require("deep-extend")):"function"==typeof define&&define.amd?define(["lodash.find","react","object-assign","hoist-non-react-statics","deep-extend"],t):e.reactDiode=t(e.find,e.react,e.objectAssign,e.hoistStatics,e.deepExtend)}(this,function(e,t,r,n,o){function i(e,t,r){if(r)return t?t(e()):e();try{var n=Promise.resolve(e());return t?n.then(t):n}catch(e){return Promise.reject(e)}}function u(){}e=e&&e.hasOwnProperty("default")?e.default:e,t=t&&t.hasOwnProperty("default")?t.default:t,r=r&&r.hasOwnProperty("default")?r.default:r,n=n&&n.hasOwnProperty("default")?n.default:n,o=o&&o.hasOwnProperty("default")?o.default:o;var a=function(){this._queryMockEnabled=!1};a.prototype.injectNetworkLayer=function(e){this._injectedNetworkLayer=e},a.prototype.injectQueryMockResolver=function(e){this._queryMockEnabled=!0,this._queryMockResolver=e},a.prototype.sendQueries=function(e,t){var n=this,o=e,i={},u=this._getCurrentNetworkLayer();return this._queryMockEnabled&&(o=e.filter(function(e){var t=n._queryMockResolver[e.type];if(t&&"function"==typeof t){var r=t(e);return!r||(i[e.type]=r,!1)}return!0})),u.sendQueries(o,t).then(function(e){return r(i,e)})},a.prototype._getCurrentNetworkLayer=function(){return this._injectedNetworkLayer};var c=function(e){this._variables={},this._containerQuery=e};function p(e,t){return Object.assign({},{type:e.type,fragment:e.fragment,resolve:e.resolve},t)}function s(e,t){return e.map(function(e){return function e(t,r){var n=t.callback,o=t.dependencies,i=o.map(function(e){return r[e.type]}).filter(function(e){return Boolean(e)});if(i.length===o.length){var u=p(t,n.apply(void 0,i));return u.dependencies?e(u,r):u}return t}(e,t)})}c.prototype.getContainerQuery=function(){return this._containerQuery},c.prototype.setVariables=function(e){o(this._variables,e)},c.prototype.getVariables=function(){return this._variables},c.prototype.compile=function(){var e=this,t=this._containerQuery.getQueryTypeMap();return Object.keys(t).map(function(r){var n=t[r];return n.fragment=e._compileFragmentKeys(n.fragmentStructure),n.params=e._compileFragmentKeys(n.paramsStructure),n})},c.prototype._compileFragmentKeys=function(e){var t=this;return Object.keys(e).reduce(function(r,n){var o=t._compileFragmentValue(n);return r[o]="object"==typeof e[n]&&null!==e[n]?t._compileFragmentKeys(e[n]):t._compileFragmentValue(e[n]),r},{})},c.prototype._compileFragmentValue=function(e){if("string"==typeof e&&"$"===e.charAt(0)){var t=e.slice(1),r=this._variables[t];return null==r?e:r}return e};var f={BATCH:"batch-query"};function y(t,n,o,i){return Object.keys(o).reduce(function(u,a){var c=o[a],p=e(t,{type:a});if(a===f.BATCH){var s=function(t,n,o){var i={};for(var u in t)if(t.hasOwnProperty(u)){var a=t[u],c=e(n,{type:u});"__additional"===u?r(i,{__additional:a}):a&&c&&(i[u]=(0,c.resolve)(a,c.fragment,o))}return i}(p.resolve(c,i),n,i);Object.assign(u,s)}else u[a]=p.resolve(c,p.fragment,i);return u},{})}function h(t,r,n){var o=[],i=r.queryTypes,u=r.forceMerge,a=i.map(function(r){return e(t,{type:r})}).filter(function(e){return Boolean(e)});if(a.length===i.length||u&&a.length>0){var c=function(e,t,r){return Object.assign({},{type:e.type,resolve:e.resolve},e.request(t,r))}(r,a,n);o.push(c)}else o=o.concat(a);var p=t.filter(function(e){return-1===a.indexOf(e)});return o=o.concat(p)}function l(e,t){return t.forEach(function(t){Object.keys(t.fragment).forEach(function(r){var n=e[t.type][r];0===Object.keys(t.fragment[r]).length&&n&&(n[g]=!0)})}),e}var d=function(){this._batchQueriesEnabled=!1,this._networkLayer=new a};d.prototype.injectNetworkLayer=function(e){this._networkLayer.injectNetworkLayer(e)},d.prototype.useMockQueries=function(e){this._networkLayer.injectQueryMockResolver(e)},d.prototype.useBatchQuery=function(e){e&&(this._batchQueryEnabled=!0,this._batchQuery=e)},d.prototype.forceFetch=function(e,t){var n=function(e,t){return e.query.compile().map(function(e){var r=e.request(e.fragment,e.params,t);return p(e,r)})}(e,t);return this._fetchQueries(n,t).then(function(t){return l(function(e,t){var n=t.query.getContainerQuery().map,o=Object.keys(n).reduce(function(t,r){return t[r]=e[n[r].type],t},{}),i=e.__additional;return i?r(o,{__additional:i}):o}(t,e),n)})},d.prototype.filterCachedFragments=function(e){var t=this.cache[e.type];if(!t)return e;var r={};return Object.keys(e.fragment).forEach(function(n){var o=t[n],i=e.fragment[n],u=Object.keys(i);0!==u.length?(r[n]={},u.forEach(function(e){o&&o[e]||(r[n][e]=i[e])})):o&&!o[g]&&(r[n]={})}),Object.assign({},e,{fragment:r})},d.prototype.fetch=function(e,t){var r=this;return i(function(){var n=new c(e).compile().map(function(e){var n=r.filterCachedFragments(e),o=n.fragment,i=n.params;if(0===Object.keys(o).length)return null;var u=e.request(o,i,t);return p(e,u)}).filter(Boolean);return Promise.resolve(r._fetchQueries(n,t)).then(function(e){o(r.cache,l(e,n))})})},d.prototype._fetchQueries=function(e,t){var r=this;void 0===t&&(t={});var n=e.filter(function(e){return e.dependencies}),o=e.filter(function(e){return!e.dependencies}),i=o;return this._batchQueryEnabled&&(i=h(i,this._batchQuery,t)),this._networkLayer.sendQueries(i,t).then(function(e){var u=y(i,o,e,t);if(n.length>0){var a=s(n,u);return r._fetchQueries(a,t).then(function(e){return Object.assign(u,e)})}return u})};var v=new d,m=t.createContext(null),g="__fac__",_=function(e,t){this.options=t,v.cache=e};_.prototype.getContents=function(){return v.cache},_.prototype.getUnresolvedQueries=function(e){return Object.keys(e.map).filter(function(t){var r=v.cache[t];if(!r)return!0;var n=e.map[t];return Object.keys(n.fragmentStructure).some(function(e){var t=r[e],o=Object.keys(n.fragmentStructure[e]);return 0===o.length?t&&"object"==typeof t?!t[g]:void 0===t:o.some(function(e){return t?void 0===t[e]:void 0===t})})})},_.prototype.hasResolved=function(e){return 0===this.getUnresolvedQueries(e).length},_.prototype.resolve=function(e){var t=this;return i(function(){return Promise.resolve(v.fetch(e,t.options)).then(function(){})})};var b=function(e,t,r){this.map={},this._queryTypeMap={},this._componentName=e,this._queries=t,this._children=r||[],this._parseQueryTypeMap(t),this._mergeChildQueryTypeMap(r),this._buildFinalQueryMap(t,r)};b.prototype.getQueryTypeMap=function(){return this._queryTypeMap},b.prototype.injectChildren=function(e){this._children=this._children.concat(e),this._mergeChildQueryTypeMap(e),this._buildFinalQueryMap(this._queries,this._children)},b.prototype._parseQueryTypeMap=function(e){var t=this;null!=e&&Object.keys(e).forEach(function(r){var n=e[r],i=t._queryTypeMap[n.type];if(i){o(i.fragmentStructure,n.fragmentStructure),o(i.params,n.params)}else{if(!n.type)throw new Error("Invalid query type in query key "+r+" at component "+t._componentName);t._queryTypeMap[n.type]=n}})},b.prototype._mergeChildQueryTypeMap=function(e){var t=this;e&&e.length&&e.forEach(function(e){var r=e.query.map;null!=r&&Object.keys(r).forEach(function(e){var n=r[e],i=t._queryTypeMap[n.type];i?o(i.fragmentStructure,n.fragmentStructure):t._queryTypeMap[n.type]=n})})},b.prototype._buildFinalQueryMap=function(e,t){var r=this;e&&(this.map=Object.keys(e).reduce(function(t,n){return t[n]=r._queryTypeMap[e[n].type],t},{})),t&&t.length&&t.forEach(function(e){var t=e.query.map;Object.keys(t).forEach(function(n){var o=t[n],i=r.map[n];if(i&&i.type!==o.type)return console.warn("Different query type for same query key %s: %s (%s) and %s (%s)",n,r._componentName,i.type,e.componentName,o.type);r.map[n]=r._queryTypeMap[o.type]})})};var q=function(e){function r(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];e.apply(this,t),this.state={error:null,loading:!0}}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.componentDidMount=function(){var e=this;return i(function(){var t=e.props,r=t.cache,n=t.query;if(!r.hasResolved(n))return function(e){if(e&&e.then)return e.then(u)}(function(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(function(){return Promise.resolve(r.resolve(n)).then(function(){e.setState({loading:!1})})},function(t){console.error("error",t),e.setState({error:t,loading:!1})}))})},r.prototype.render=function(){var e=this.props,r=e.Component,n=e.wrapper,o=e.cache,i=e.query,u=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&(r[n]=e[n]);return r}(e,["Component","wrapper","cache","query"]);if(null!==this.state.error)return t.createElement("span",null,this.state.error.message);var a=!o.hasResolved(i)&&this.state.loading?null:t.createElement(r,Object.assign({},u,o.getContents()));return n?t.createElement("div",n,a):a},r}(t.Component);function w(e,i){void 0===i&&(i={});var u,a=e.displayName||e.name,c="Diode("+a+")",p=new b(a,i.queries,i.children);function s(r){return u||(u=function(e,r,o){var i="Diode("+(e.displayName||e.name)+")",u=function(n){function i(e){n.call(this,e),this.wrapperInfo=r.wrapperInfo}return n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i,i.prototype.render=function(){var r=this,n=this.props,i=n.wrapperInfo?n.wrapperInfo:this.wrapperInfo;return t.createElement(m.Consumer,null,function(n){return t.createElement(q,Object.assign({},r.props,{Component:e,wrapper:i,query:o,cache:n}))})},i}(t.Component);return u.displayName=i,n(u,e)}(e,i,p)),new u(r)}return s.setWrapperInfo=function(e){r(i.wrapperInfo,e)},s.getWrapperInfo=function(e){return i.wrapperInfo[e]},s.getComponent=function(){return e},s.getChildren=function(){return i.children&&i.children.length?i.children:[]},s.query=o(p,e.query),s.displayName=c,s.componentName=a,n(s,e,{query:!0})}return{Store:v,CacheProvider:m.Provider,QueryTypes:f,createCache:function(e,t){return new _(e,t)},createContainer:w,createRootContainer:function(e,t){var r=w(e,t);return r.query=new c(r.query),r},createQuery:function(e,t,r){if(void 0===r&&(r={}),"string"!=typeof e.type)throw new TypeError("Expected query definition to have query type");if("function"!=typeof e.request)throw new TypeError("Expected query definition to have .request() method");if("function"!=typeof e.resolve)throw new TypeError("Expected query definition to have .resolve() method");var n=Object.create(e);return n.fragmentStructure=t,n.paramsStructure=r,n},queryRequest:function(e,t,r,n){return void 0===n&&(n={}),{pending:!1,url:e,method:t,payload:r,headers:n}},waitForQuery:function(e,t){return e instanceof Array||(e=[e]),{pending:!0,dependencies:e,callback:t}},useBatchQuery:v.useBatchQuery.bind(v),useMockQueries:v.useMockQueries.bind(v),injectNetworkLayer:v.injectNetworkLayer.bind(v)}}); | ||
//# sourceMappingURL=DiodePublic.umd.js.map |
{ | ||
"name": "react-diode", | ||
"version": "0.5.0-1", | ||
"version": "0.5.0-2", | ||
"description": "Endpoint agnostic, unidirectional data fetching for React applications", | ||
@@ -5,0 +5,0 @@ "source": "src/DiodePublic.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
152206