You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Copyright (c) Microsoft Corporation. All rights reserved.
// This code is licensed by Microsoft Corporation under the terms
// of the MICROSOFT REACTIVE EXTENSIONS FOR JAVASCRIPT AND .NET LIBRARIES License.
// See http://go.microsoft.com/fwlink/?LinkId=186234.
(function(){vara=this;varb;if(typeofProvideCustomRxRootObject=="undefined")b=a.Rx;elseb=ProvideCustomRxRootObject();varc=undefined;vard=function(m,n){returnm===n;};vare=function(m){returnm;};varf=b.Observable;varg=f.prototype;varh="Sequence contains no elements.";vari=f.CreateWithDisposable;varj=Rx.Scheduler.CurrentThread;vark=function(m){if(m.length==0)throwh;returnm[0];};g.Aggregate=function(m,n){returnthis.Scan0(m,n).Final();};g.Aggregate1=function(m){returnthis.Scan1(m).Final();};g.IsEmpty=function(){varm=this;returni(function(n){returnm.Subscribe(function(){n.OnNext(false);n.OnCompleted();},function(o){n.OnError(o);},function(){n.OnNext(true);n.OnCompleted();});});};g.Any=function(m){if(m===c)returnthis.IsEmpty().Select(function(n){return!n;});returnthis.Where(m).Any();};g.All=function(m){if(m===c)m=e;returnthis.Where(function(n){return!m(n);}).IsEmpty();};g.Contains=function(m,n){if(n===c)n=d;returnthis.Where(function(o){returnn(o,m);}).Any();};g.Count=function(){returnthis.Aggregate(0,function(m,n){returnm+1;});};g.Sum=function(){returnthis.Aggregate(0,function(m,n){returnm+n;});};g.Average=function(){returnthis.Scan({sum:0,count:0},function(m,n){return{sum:m.sum+n,count:m.count+1};}).Final().Select(function(m){returnm.sum/m.count;});};g.Final=function(){varm=this;returni(function(n){varo;varp=false;returnm.Subscribe(function(q){p=true;o=q;},function(q){n.OnError(q);},function(){if(!p)n.OnError(h);n.OnNext(o);n.OnCompleted();});});};varl=function(m,n,o){returni(function(p){varq=false;varr;vars=[];returnm.Subscribe(function(t){varu;try{u=n(t);}catch(w){p.OnError(w);return;}varv=0;if(!q){q=true;r=u;}elsetry{v=o(u,r);}catch(w){p.OnError(w);return;}if(v>0){r=u;s=[];}if(v>=0)s.push(t);},function(t){p.OnError(t);},function(){p.OnNext(s);p.OnCompleted();});});};g.MinBy=function(m,n){if(m===c)m=e;varo;if(n===c)o=function(p,q){returnq-p;};elseo=function(p,q){returnn(p,q)*-1;};returnl(this,m,o);};g.Min=function(m,n){returnthis.MinBy(m,n).Select(k);};g.MaxBy=function(m,n){if(m===c)m=e;if(n===c)n=function(o,p){returno-p;};returnl(this,m,n);};g.Max=function(m,n){return this.MaxBy(m,n).Select(k);};})();