UNPKG

5.5 kBJavaScriptView Raw
1(function(v){"object"===typeof exports&&"undefined"!==typeof module?module.exports=v():"function"===typeof define&&define.amd?define([],v):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).Cycle=v()})(function(){return function a(m,c,q){function g(k,h){if(!c[k]){if(!m[k]){var l="function"==typeof require&&require;if(!h&&l)return l(k,!0);if(e)return e(k,!0);h=Error("Cannot find module '"+k+"'");throw h.code="MODULE_NOT_FOUND",h;}h=c[k]={exports:{}};
2m[k][0].call(h.exports,function(a){var e=m[k][1][a];return g(e?e:a)},h,h.exports,a,m,c,q)}return c[k].exports}for(var e="function"==typeof require&&require,l=0;l<q.length;l++)g(q[l]);return g}({1:[function(a,m,c){function q(){throw Error("setTimeout has not been defined");}function g(){throw Error("clearTimeout has not been defined");}function e(b){if(t===setTimeout)return setTimeout(b,0);if((t===q||!t)&&setTimeout)return t=setTimeout,setTimeout(b,0);try{return t(b,0)}catch(y){try{return t.call(null,
3b,0)}catch(u){return t.call(this,b,0)}}}function l(b){if(n===clearTimeout)return clearTimeout(b);if((n===g||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(b);try{return n(b)}catch(y){try{return n.call(null,b)}catch(u){return n.call(this,b)}}}function k(){f&&p&&(f=!1,p.length?b=p.concat(b):d=-1,b.length&&h())}function h(){if(!f){var a=e(k);f=!0;for(var c=b.length;c;){p=b;for(b=[];++d<c;)p&&p[d].run();d=-1;c=b.length}p=null;f=!1;l(a)}}function w(b,a){this.fun=b;this.array=a}function r(){}a=m.exports=
4{};try{var t="function"===typeof setTimeout?setTimeout:q}catch(x){t=q}try{var n="function"===typeof clearTimeout?clearTimeout:g}catch(x){n=g}var b=[],f=!1,p,d=-1;a.nextTick=function(a){var d=Array(arguments.length-1);if(1<arguments.length)for(var u=1;u<arguments.length;u++)d[u-1]=arguments[u];b.push(new w(a,d));1!==b.length||f||e(h)};w.prototype.run=function(){this.fun.apply(null,this.array)};a.title="browser";a.browser=!0;a.env={};a.argv=[];a.version="";a.versions={};a.on=r;a.addListener=r;a.once=
5r;a.off=r;a.removeListener=r;a.removeAllListeners=r;a.emit=r;a.binding=function(b){throw Error("process.binding is not supported");};a.cwd=function(){return"/"};a.chdir=function(b){throw Error("process.chdir is not supported");};a.umask=function(){return 0}},{}],2:[function(a,m,c){(function(a){function g(){var e="undefined"!==typeof window?window:"undefined"!==typeof a?a:this;e.Cyclejs=e.Cyclejs||{};e=e.Cyclejs;e.adaptStream=e.adaptStream||function(a){return a};return e}Object.defineProperty(c,"__esModule",
6{value:!0});c.setAdapt=function(a){g().adaptStream=a};c.adapt=function(a){return g().adaptStream(a)}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],3:[function(a,m,c){(function(q){function g(b){var a={},p;for(p in b)b.hasOwnProperty(p)&&(a[p]=r.default.create());return a}function e(b,a){var f={},d;for(d in b)b.hasOwnProperty(d)&&(f[d]=b[d](a[d],d),f[d]&&"object"===typeof f[d]&&(f[d]._isCycleSource=d));return f}function l(b){for(var a in b)b.hasOwnProperty(a)&&
7b[a]&&"function"===typeof b[a].shamefullySendNext&&(b[a]=t.adapt(b[a]));return b}function k(a,f){var b=Object.keys(a).filter(function(a){return!!f[a]}),d={},e={};b.forEach(function(a){d[a]={_n:[],_e:[]};e[a]={next:function(b){return d[a]._n.push(b)},error:function(b){return d[a]._e.push(b)},complete:function(){}}});var c=b.map(function(b){return r.default.fromObservable(a[b]).subscribe(e[b])});b.forEach(function(a){var b=f[a],c=function(a){n(function(){return b._n(a)})},g=function(a){n(function(){(console.error||
8console.log)(a);b._e(a)})};d[a]._n.forEach(c);d[a]._e.forEach(g);e[a].next=c;e[a].error=g;e[a]._n=c;e[a]._e=g});d=null;return function(){c.forEach(function(a){return a.unsubscribe()});b.forEach(function(a){return f[a]._c()})}}function h(a,c){if("function"!==typeof a)throw Error("First argument given to Cycle must be the 'main' function.");if("object"!==typeof c||null===c)throw Error("Second argument given to Cycle must be an object with driver functions as properties.");if(0===Object.keys(c).length)throw Error("Second argument given to Cycle must be an object with at least one driver function declared as a property.");
9var b=g(c),d=e(c,b);c=l(d);var f=a(c);"undefined"!==typeof window&&(window.Cyclejs=window.Cyclejs||{},window.Cyclejs.sinks=f);return{sinks:f,sources:d,run:function(){var a=k(f,b);return function(){for(var b in d)d.hasOwnProperty(b)&&d[b]&&d[b].dispose&&d[b].dispose();a()}}}}function m(a,c){a=h(a,c);"undefined"!==typeof window&&window.CyclejsDevTool_startGraphSerializer&&window.CyclejsDevTool_startGraphSerializer(a.sinks);return a.run()}Object.defineProperty(c,"__esModule",{value:!0});var r="undefined"!==
10typeof window?window.xstream:"undefined"!==typeof q?q.xstream:null,t=a("./adapt"),n=a("quicktask").default();c.setup=h;c.run=m;c.default=m}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"./adapt":2,quicktask:4}],4:[function(a,m,c){(function(a){Object.defineProperty(c,"__esModule",{value:!0});c.default=function(){if("undefined"!==typeof MutationObserver){var c=document.createTextNode(""),e=[],l=0;(new MutationObserver(function(){for(;e.length;)e.shift()()})).observe(c,
11{characterData:!0});return function(a){e.push(a);c.data=l=1-l}}return"undefined"!==typeof setImmediate?setImmediate:"undefined"!==typeof a?a.nextTick:setTimeout}}).call(this,a("_process"))},{_process:1}]},{},[3])(3)});
\No newline at end of file