UNPKG

redux-fluorine

Version:

A Redux enhancer to manage groups of actions as observables (agendas)

1 lines 3.85 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ReduxFluorine=e():t.ReduxFluorine=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,e,n){Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},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=10)}([function(t,e,n){"use strict";function r(t,e){return{type:o,anchor:t,actions:e}}n.d(e,"b",function(){return o}),e.a=r;var o="@@redux-fluorine/RECOVER_AFTER_ERROR"},function(t,e,n){t.exports=n(7)},function(t,e,n){"use strict";function r(){return this}function o(t){function e(){var e=t.getState(),n=e.state;return n}function o(e){return n.i(f.a)(e)?n.i(s.a)(e,t):t.dispatch(e)}function u(e){t.replaceReducer(n.i(l.a)(e))}function i(n){function r(){n.next&&n.next(e())}if("object"!=typeof n)throw new TypeError("Expected the observer to be an object.");r();var o=t.subscribe(r);return{unsubscribe:o}}function c(){var t;return t={subscribe:i},t[a.a]=r,t}var p;return d({},t,(p={preAgendaStore:t,dispatch:o,getState:e,replaceReducer:u},p[a.a]=c,p))}function u(t){return function(e,r,u){var i=n.i(l.a)(e,r),c=t(i,void 0,u);if(c.preAgendaStore)throw Error("createAgendaEnhancer: The Redux Fluorine enhancer should only be applied once.");return o(c)}}function i(){return u}var c=n(1),a=n.n(c),f=n(4),s=n(3),l=n(6);e.a=i;var d=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}},function(t,e,n){"use strict";function r(){}function o(t,e){function o(){i(n.i(u.a)(a,f))}var i=e.dispatch,c=e.getState,a=c(),f=[],s=t.subscribe({next:function(t){i(t),f.push(t)},error:function(t){console.error&&console.error(t),f.length&&setTimeout(o)},complete:r});return{unsubscribe:s.unsubscribe.bind(s)}}var u=n(0);e.a=o},function(t,e,n){"use strict";function r(t){return t&&"function"==typeof t.subscribe&&"function"==typeof t[u.a]}var o=n(1),u=n.n(o);e.a=r},function(t,e,n){"use strict";function r(t,e,n){for(var r=!1,o=e.lastValidState||e,u=o;o.next;){o=o.next;var i=o,c=i.action;n.indexOf(c)>-1?(r=!0,o.lastValidState=u):(r&&(o.state=t(u.state,c)),u.next=o,u=o)}return u.next=null,u}e.a=r},function(t,e,n){"use strict";function r(t,e){if("function"!=typeof t)throw Error("wrapStateReducer: Expected `reducer` to be a function.");var r={action:null,state:e,next:null};return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,i=arguments[1];if(i.type===o.b){var c=i.anchor,a=i.actions;return n.i(u.a)(t,c,a)}var f=e.state,s=t(f,i);return e.next={action:i,state:s,next:null}}}var o=n(0),u=n(5);e.a=r},function(t,e,n){"use strict";(function(t){function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(8),u=r(o),i=void 0;void 0!==t?i=t:"undefined"!=typeof window&&(i=window);var c=(0,u.default)(i);e.default=c}).call(e,n(9))},function(t,e){"use strict";function n(t){var e,n=t.Symbol;return"function"==typeof n?n.observable?e=n.observable:(e=n("observable"),n.observable=e):e="@@observable",e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=n},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r=n(2),o=n(0);n.d(e,"createAgendaEnhancer",function(){return r.a}),n.d(e,"RECOVER_AFTER_ERROR",function(){return o.b})}])});