Greasy Fork is available in English.

Redux-saga/effects

Redux-saga/effects bundled

Dit script moet niet direct worden geïnstalleerd - het is een bibliotheek voor andere scripts om op te nemen met de meta-richtlijn // @require https://greasyfork.org/scripts/396833-redux-saga-effects/code/Redux-sagaeffects.js?version=775087

// ==UserScript==
// @name         Redux-saga/effects
// @namespace    eisen-stein
// @version      1.0.0
// @description  Redux-saga/effects bundled
// ==/UserScript==

!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["redux-saga/effects"]=t():n["redux-saga/effects"]=t()}(window,(function(){return function(n){var t={};function e(r){if(t[r])return t[r].exports;var u=t[r]={i:r,l:!1,exports:{}};return n[r].call(u.exports,u,u.exports,e),u.l=!0,u.exports}return e.m=n,e.c=t,e.d=function(n,t,r){e.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:r})},e.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},e.t=function(n,t){if(1&t&&(n=e(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var u in n)e.d(r,u,function(t){return n[t]}.bind(null,u));return r},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},e.p="",e(e.s=0)}([function(n,t,e){"use strict";e.r(t);var r=function(n){return"@@redux-saga/"+n},u=r("CANCEL_PROMISE"),o=r("IO"),a=r("MULTICAST"),f=r("SELF_CANCELLATION");function c(){return(c=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n}).apply(this,arguments)}var i=function(n){return null!=n},l=function(n){return"function"==typeof n},d=function(n){return"string"==typeof n},v=Array.isArray,p=function n(t){return t&&(d(t)||s(t)||l(t)||v(t)&&t.every(n))},y=function(n){return n&&l(n.take)&&l(n.close)},s=function(n){return Boolean(n)&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype};var S=function(n,t){var e;void 0===t&&(t=!0);var r=new Promise((function(r){e=setTimeout(r,n,t)}));return r[u]=function(){clearTimeout(e)},r};var A=function(n){return n};"function"==typeof Symbol&&Symbol.asyncIterator&&Symbol.asyncIterator;var C=function(n){throw n},E=function(n){return{value:n,done:!0}};function h(n,t){void 0===n&&(n=10);var e=new Array(n),r=0,u=0,o=0,a=function(t){e[u]=t,u=(u+1)%n,r++},f=function(){if(0!=r){var t=e[o];return e[o]=null,r--,o=(o+1)%n,t}},c=function(){for(var n=[];r;)n.push(f());return n};return{isEmpty:function(){return 0==r},put:function(f){var i;if(r<n)a(f);else switch(t){case 1:throw new Error("Channel's Buffer overflow!");case 3:e[u]=f,o=u=(u+1)%n;break;case 4:i=2*n,e=c(),r=e.length,u=e.length,o=0,e.length=i,n=i,a(f)}},take:f,flush:c}}var q=function(n){return h(n,3)},g=Object.freeze({__proto__:null,TAKE:"TAKE",PUT:"PUT",ALL:"ALL",RACE:"RACE",CALL:"CALL",CPS:"CPS",FORK:"FORK",JOIN:"JOIN",CANCEL:"CANCEL",SELECT:"SELECT",ACTION_CHANNEL:"ACTION_CHANNEL",CANCELLED:"CANCELLED",FLUSH:"FLUSH",GET_CONTEXT:"GET_CONTEXT",SET_CONTEXT:"SET_CONTEXT"}),L=function(n,t){var e;return(e={})[o]=!0,e.combinator=!1,e.type=n,e.payload=t,e},T=function(n){return L("FORK",c({},n.payload,{detached:!0}))};function b(n,t){return void 0===n&&(n="*"),p(n)?L("TAKE",{pattern:n}):y(e=n)&&e[a]&&i(t)&&p(t)?L("TAKE",{channel:n,pattern:t}):y(n)?L("TAKE",{channel:n}):void 0;var e}var x=function(){var n=b.apply(void 0,arguments);return n.payload.maybe=!0,n};function m(n,t){return null==t&&(t=n,n=void 0),L("PUT",{channel:n,action:t})}var w=function(){var n=m.apply(void 0,arguments);return n.payload.resolve=!0,n};function O(n){var t=L("ALL",n);return t.combinator=!0,t}function N(n){var t=L("RACE",n);return t.combinator=!0,t}function _(n,t){var e,r=null;return l(n)?e=n:(v(n)?(r=n[0],e=n[1]):(r=n.context,e=n.fn),r&&d(e)&&l(r[e])&&(e=r[e])),{context:r,fn:e,args:t}}function U(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return L("CALL",_(n,e))}function P(n,t,e){void 0===e&&(e=[]);return L("CALL",_([n,t],e))}function j(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return L("CPS",_(n,e))}function I(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return L("FORK",_(n,e))}function k(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return T(I.apply(void 0,[n].concat(e)))}function K(n){return L("JOIN",n)}function R(n){return void 0===n&&(n=f),L("CANCEL",n)}function F(n){void 0===n&&(n=A);for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return L("SELECT",{selector:n,args:e})}function M(n,t){return L("ACTION_CHANNEL",{pattern:n,buffer:t})}function H(){return L("CANCELLED",{})}function X(n){return L("FLUSH",n)}function D(n){return L("GET_CONTEXT",n)}function G(n){return L("SET_CONTEXT",n)}var J=U.bind(null,S),B=function(n){return{done:!0,value:n}},z={};function Q(n){return y(n)?"channel":l(t=n)&&t.hasOwnProperty("toString")?String(n):l(n)?n.name:String(n);var t}function V(n,t,e){var r,u,o,a=t;function f(t,e){if(a===z)return B(t);if(e&&!u)throw a=z,e;r&&r(t);var f=e?n[u](e):n[a]();return a=f.nextState,o=f.effect,r=f.stateUpdater,u=f.errorState,a===z?B(t):o}return function(n,t,e){void 0===t&&(t=C),void 0===e&&(e="iterator");var r={meta:{name:e},next:n,throw:t,return:E,isSagaIterator:!0};return"undefined"!=typeof Symbol&&(r[Symbol.iterator]=function(){return r}),r}(f,(function(n){return f(null,n)}),e)}function W(n,t){for(var e=arguments.length,r=new Array(e>2?e-2:0),u=2;u<e;u++)r[u-2]=arguments[u];var o,a={done:!1,value:b(n)},f=function(n){return{done:!1,value:I.apply(void 0,[t].concat(r,[n]))}},c=function(n){return o=n};return V({q1:function(){return{nextState:"q2",effect:a,stateUpdater:c}},q2:function(){return{nextState:"q1",effect:f(o)}}},"q1","takeEvery("+Q(n)+", "+t.name+")")}function Y(n,t){for(var e=arguments.length,r=new Array(e>2?e-2:0),u=2;u<e;u++)r[u-2]=arguments[u];var o,a,f={done:!1,value:b(n)},c=function(n){return{done:!1,value:I.apply(void 0,[t].concat(r,[n]))}},i=function(n){return{done:!1,value:R(n)}},l=function(n){return o=n},d=function(n){return a=n};return V({q1:function(){return{nextState:"q2",effect:f,stateUpdater:d}},q2:function(){return o?{nextState:"q3",effect:i(o)}:{nextState:"q1",effect:c(a),stateUpdater:l}},q3:function(){return{nextState:"q1",effect:c(a),stateUpdater:l}}},"q1","takeLatest("+Q(n)+", "+t.name+")")}function Z(n,t){for(var e=arguments.length,r=new Array(e>2?e-2:0),u=2;u<e;u++)r[u-2]=arguments[u];var o,a={done:!1,value:b(n)},f=function(n){return{done:!1,value:U.apply(void 0,[t].concat(r,[n]))}},c=function(n){return o=n};return V({q1:function(){return{nextState:"q2",effect:a,stateUpdater:c}},q2:function(){return{nextState:"q1",effect:f(o)}}},"q1","takeLeading("+Q(n)+", "+t.name+")")}function $(n,t,e){for(var r=arguments.length,u=new Array(r>3?r-3:0),o=3;o<r;o++)u[o-3]=arguments[o];var a,f,c={done:!1,value:M(t,q(1))},i=function(){return{done:!1,value:b(f)}},l=function(n){return{done:!1,value:I.apply(void 0,[e].concat(u,[n]))}},d={done:!1,value:J(n)},v=function(n){return a=n},p=function(n){return f=n};return V({q1:function(){return{nextState:"q2",effect:c,stateUpdater:p}},q2:function(){return{nextState:"q3",effect:i(),stateUpdater:v}},q3:function(){return{nextState:"q4",effect:l(a)}},q4:function(){return{nextState:"q2",effect:d}}},"q1","throttle("+Q(t)+", "+e.name+")")}function nn(n,t,e){for(var r=n,u=arguments.length,o=new Array(u>3?u-3:0),a=3;a<u;a++)o[a-3]=arguments[a];var f={done:!1,value:U.apply(void 0,[e].concat(o))},c={done:!1,value:J(t)};return V({q1:function(){return{nextState:"q2",effect:f,errorState:"q10"}},q2:function(){return{nextState:z}},q10:function(n){if((r-=1)<=0)throw n;return{nextState:"q1",effect:c}}},"q1","retry("+e.name+")")}function tn(n,t,e){for(var r=arguments.length,u=new Array(r>3?r-3:0),o=3;o<r;o++)u[o-3]=arguments[o];var a,f,c={done:!1,value:b(t)},i={done:!1,value:N({action:b(t),debounce:J(n)})},l=function(n){return{done:!1,value:I.apply(void 0,[e].concat(u,[n]))}},d=function(n){return{done:!1,value:n}},v=function(n){return a=n},p=function(n){return f=n};return V({q1:function(){return{nextState:"q2",effect:c,stateUpdater:v}},q2:function(){return{nextState:"q3",effect:i,stateUpdater:p}},q3:function(){return f.debounce?{nextState:"q1",effect:l(a)}:{nextState:"q2",effect:d(f.action),stateUpdater:v}}},"q1","debounce("+Q(t)+", "+e.name+")")}function en(n,t){for(var e=arguments.length,r=new Array(e>2?e-2:0),u=2;u<e;u++)r[u-2]=arguments[u];return I.apply(void 0,[W,n,t].concat(r))}function rn(n,t){for(var e=arguments.length,r=new Array(e>2?e-2:0),u=2;u<e;u++)r[u-2]=arguments[u];return I.apply(void 0,[Y,n,t].concat(r))}function un(n,t){for(var e=arguments.length,r=new Array(e>2?e-2:0),u=2;u<e;u++)r[u-2]=arguments[u];return I.apply(void 0,[Z,n,t].concat(r))}function on(n,t,e){for(var r=arguments.length,u=new Array(r>3?r-3:0),o=3;o<r;o++)u[o-3]=arguments[o];return I.apply(void 0,[$,n,t,e].concat(u))}function an(n,t,e){for(var r=arguments.length,u=new Array(r>3?r-3:0),o=3;o<r;o++)u[o-3]=arguments[o];return U.apply(void 0,[nn,n,t,e].concat(u))}function fn(n,t,e){for(var r=arguments.length,u=new Array(r>3?r-3:0),o=3;o<r;o++)u[o-3]=arguments[o];return I.apply(void 0,[tn,n,t,e].concat(u))}e.d(t,"actionChannel",(function(){return M})),e.d(t,"all",(function(){return O})),e.d(t,"apply",(function(){return P})),e.d(t,"call",(function(){return U})),e.d(t,"cancel",(function(){return R})),e.d(t,"cancelled",(function(){return H})),e.d(t,"cps",(function(){return j})),e.d(t,"delay",(function(){return J})),e.d(t,"effectTypes",(function(){return g})),e.d(t,"flush",(function(){return X})),e.d(t,"fork",(function(){return I})),e.d(t,"getContext",(function(){return D})),e.d(t,"join",(function(){return K})),e.d(t,"put",(function(){return m})),e.d(t,"putResolve",(function(){return w})),e.d(t,"race",(function(){return N})),e.d(t,"select",(function(){return F})),e.d(t,"setContext",(function(){return G})),e.d(t,"spawn",(function(){return k})),e.d(t,"take",(function(){return b})),e.d(t,"takeMaybe",(function(){return x})),e.d(t,"debounce",(function(){return fn})),e.d(t,"retry",(function(){return an})),e.d(t,"takeEvery",(function(){return en})),e.d(t,"takeLatest",(function(){return rn})),e.d(t,"takeLeading",(function(){return un})),e.d(t,"throttle",(function(){return on}))}])}));