Repository: Reactive-Extensions/RxJS Branch: master Commit: 6770d24307ed Files: 1749 Total size: 14.5 MB Directory structure: gitextract_8zo3mywg/ ├── .coveralls.yml ├── .editorconfig ├── .gitattributes ├── .gitignore ├── .jamignore ├── .jscsrc ├── .jscsrc.todo ├── .jshintrc ├── .npmignore ├── .nuget/ │ ├── nuget.config │ └── nuget.targets ├── .travis.yml ├── Gruntfile.js ├── authors.txt ├── bower.json ├── code-of-conduct.md ├── component.json ├── contributing.md ├── dist/ │ ├── rx.aggregates.js │ ├── rx.all.compat.js │ ├── rx.all.js │ ├── rx.async.compat.js │ ├── rx.async.js │ ├── rx.backpressure.js │ ├── rx.binding.js │ ├── rx.coincidence.js │ ├── rx.compat.js │ ├── rx.core.binding.js │ ├── rx.core.js │ ├── rx.core.testing.js │ ├── rx.experimental.js │ ├── rx.joinpatterns.js │ ├── rx.js │ ├── rx.lite.compat.js │ ├── rx.lite.extras.compat.js │ ├── rx.lite.extras.js │ ├── rx.lite.js │ ├── rx.sorting.js │ ├── rx.testing.js │ ├── rx.time.js │ └── rx.virtualtime.js ├── doc/ │ ├── api/ │ │ ├── config/ │ │ │ └── readme.md │ │ ├── core/ │ │ │ ├── notification.md │ │ │ ├── observable.md │ │ │ ├── observer.md │ │ │ └── operators/ │ │ │ ├── amb.md │ │ │ ├── ambproto.md │ │ │ ├── and.md │ │ │ ├── asobservable.md │ │ │ ├── average.md │ │ │ ├── buffer.md │ │ │ ├── bufferwithcount.md │ │ │ ├── bufferwithtime.md │ │ │ ├── bufferwithtimeorcount.md │ │ │ ├── case.md │ │ │ ├── catch.md │ │ │ ├── catchproto.md │ │ │ ├── combinelatest.md │ │ │ ├── combinelatestproto.md │ │ │ ├── concat.md │ │ │ ├── concatall.md │ │ │ ├── concatmap.md │ │ │ ├── concatmapobserver.md │ │ │ ├── concatproto.md │ │ │ ├── connect.md │ │ │ ├── controlled.md │ │ │ ├── count.md │ │ │ ├── create.md │ │ │ ├── debounce.md │ │ │ ├── defaultifempty.md │ │ │ ├── defer.md │ │ │ ├── delay.md │ │ │ ├── delaysubscription.md │ │ │ ├── dematerialize.md │ │ │ ├── distinct.md │ │ │ ├── distinctuntilchanged.md │ │ │ ├── do.md │ │ │ ├── dooncompleted.md │ │ │ ├── doonerror.md │ │ │ ├── doonnext.md │ │ │ ├── dowhile.md │ │ │ ├── elementat.md │ │ │ ├── empty.md │ │ │ ├── every.md │ │ │ ├── expand.md │ │ │ ├── finally.md │ │ │ ├── find.md │ │ │ ├── findindex.md │ │ │ ├── first.md │ │ │ ├── flatmapfirst.md │ │ │ ├── flatmaplatest.md │ │ │ ├── flatmapobserver.md │ │ │ ├── flatmapwithmaxconcurrent.md │ │ │ ├── for.md │ │ │ ├── forkjoin.md │ │ │ ├── forkjoinproto.md │ │ │ ├── from.md │ │ │ ├── fromarray.md │ │ │ ├── fromcallback.md │ │ │ ├── fromevent.md │ │ │ ├── fromeventpattern.md │ │ │ ├── fromnodecallback.md │ │ │ ├── frompromise.md │ │ │ ├── generate.md │ │ │ ├── generatewithabsolutetime.md │ │ │ ├── generatewithrelativetime.md │ │ │ ├── groupby.md │ │ │ ├── groupbyuntil.md │ │ │ ├── groupjoin.md │ │ │ ├── if.md │ │ │ ├── ignoreelements.md │ │ │ ├── includes.md │ │ │ ├── indexof.md │ │ │ ├── interval.md │ │ │ ├── isempty.md │ │ │ ├── join.md │ │ │ ├── jortsort.md │ │ │ ├── jortsortuntil.md │ │ │ ├── last.md │ │ │ ├── lastindexof.md │ │ │ ├── let.md │ │ │ ├── manyselect.md │ │ │ ├── materialize.md │ │ │ ├── max.md │ │ │ ├── maxby.md │ │ │ ├── merge.md │ │ │ ├── mergeall.md │ │ │ ├── mergedelayerror.md │ │ │ ├── mergeproto.md │ │ │ ├── min.md │ │ │ ├── minby.md │ │ │ ├── multicast.md │ │ │ ├── never.md │ │ │ ├── observeon.md │ │ │ ├── of.md │ │ │ ├── ofarraychanges.md │ │ │ ├── ofobjectchanges.md │ │ │ ├── ofwithscheduler.md │ │ │ ├── onerrorresumenext.md │ │ │ ├── onerrorresumenextproto.md │ │ │ ├── pairs.md │ │ │ ├── pairwise.md │ │ │ ├── partition.md │ │ │ ├── pausable.md │ │ │ ├── pausablebuffered.md │ │ │ ├── pluck.md │ │ │ ├── publish.md │ │ │ ├── publishlast.md │ │ │ ├── publishvalue.md │ │ │ ├── range.md │ │ │ ├── reduce.md │ │ │ ├── refcount.md │ │ │ ├── repeat.md │ │ │ ├── repeatproto.md │ │ │ ├── repeatwhen.md │ │ │ ├── replay.md │ │ │ ├── retry.md │ │ │ ├── retrywhen.md │ │ │ ├── return.md │ │ │ ├── sample.md │ │ │ ├── scan.md │ │ │ ├── select.md │ │ │ ├── selectmany.md │ │ │ ├── sequenceequal.md │ │ │ ├── share.md │ │ │ ├── sharereplay.md │ │ │ ├── sharevalue.md │ │ │ ├── single.md │ │ │ ├── singleinstance.md │ │ │ ├── skip.md │ │ │ ├── skiplast.md │ │ │ ├── skiplastwithtime.md │ │ │ ├── skipuntil.md │ │ │ ├── skipuntilwithtime.md │ │ │ ├── skipwhile.md │ │ │ ├── slice.md │ │ │ ├── some.md │ │ │ ├── spawn.md │ │ │ ├── start.md │ │ │ ├── startasync.md │ │ │ ├── startwith.md │ │ │ ├── subscribe.md │ │ │ ├── subscribeon.md │ │ │ ├── subscribeoncompleted.md │ │ │ ├── subscribeonerror.md │ │ │ ├── subscribeonnext.md │ │ │ ├── sum.md │ │ │ ├── switch.md │ │ │ ├── switchfirst.md │ │ │ ├── take.md │ │ │ ├── takelast.md │ │ │ ├── takelastbuffer.md │ │ │ ├── takelastbufferwithtime.md │ │ │ ├── takelastwithtime.md │ │ │ ├── takeuntil.md │ │ │ ├── takeuntilwithtime.md │ │ │ ├── takewhile.md │ │ │ ├── thendo.md │ │ │ ├── throttle.md │ │ │ ├── throw.md │ │ │ ├── timeinterval.md │ │ │ ├── timeout.md │ │ │ ├── timer.md │ │ │ ├── timestamp.md │ │ │ ├── toarray.md │ │ │ ├── toasync.md │ │ │ ├── tomap.md │ │ │ ├── topromise.md │ │ │ ├── toset.md │ │ │ ├── transduce.md │ │ │ ├── using.md │ │ │ ├── when.md │ │ │ ├── where.md │ │ │ ├── while.md │ │ │ ├── window.md │ │ │ ├── windowwithcount.md │ │ │ ├── windowwithtime.md │ │ │ ├── windowwithtimeorcount.md │ │ │ ├── withlatestfrom.md │ │ │ ├── wrap.md │ │ │ ├── zip.md │ │ │ ├── zipiterable.md │ │ │ └── zipproto.md │ │ ├── disposables/ │ │ │ ├── compositedisposable.md │ │ │ ├── disposable.md │ │ │ ├── refcountdisposable.md │ │ │ ├── serialdisposable.md │ │ │ └── singleassignmentdisposable.md │ │ ├── helpers/ │ │ │ └── readme.md │ │ ├── schedulers/ │ │ │ ├── historicalscheduler.md │ │ │ ├── scheduler.md │ │ │ └── virtualtimescheduler.md │ │ ├── subjects/ │ │ │ ├── asyncsubject.md │ │ │ ├── behaviorsubject.md │ │ │ ├── replaysubject.md │ │ │ └── subject.md │ │ └── testing/ │ │ ├── reactivetest.md │ │ ├── recorded.md │ │ ├── subscription.md │ │ └── testscheduler.md │ ├── designguidelines/ │ │ └── readme.md │ ├── gettingstarted/ │ │ ├── backpressure.md │ │ ├── callbacks.md │ │ ├── categories.md │ │ ├── combining.md │ │ ├── creating.md │ │ ├── creatingquerying.md │ │ ├── errors.md │ │ ├── events.md │ │ ├── exploring.md │ │ ├── generators.md │ │ ├── operators.md │ │ ├── promises.md │ │ ├── querying.md │ │ ├── schedulers.md │ │ ├── subjects.md │ │ ├── testing.md │ │ ├── transducers.md │ │ ├── what.md │ │ ├── which-instance.md │ │ └── which-static.md │ ├── howdoi/ │ │ ├── angular.md │ │ ├── createcustomoperators.md │ │ ├── eventemitter.md │ │ ├── jquery.md │ │ └── wrap.md │ ├── libraries/ │ │ ├── core/ │ │ │ ├── rx.core.binding.md │ │ │ ├── rx.core.md │ │ │ └── rx.core.testing.md │ │ ├── lite/ │ │ │ ├── rx.lite.aggregates.md │ │ │ ├── rx.lite.async.md │ │ │ ├── rx.lite.coincidence.md │ │ │ ├── rx.lite.experimental.md │ │ │ ├── rx.lite.extras.md │ │ │ ├── rx.lite.joinpatterns.md │ │ │ ├── rx.lite.md │ │ │ ├── rx.lite.testing.md │ │ │ ├── rx.lite.time.md │ │ │ └── rx.lite.virtualtime.md │ │ └── main/ │ │ ├── rx.aggregates.md │ │ ├── rx.async.md │ │ ├── rx.backpressure.md │ │ ├── rx.binding.md │ │ ├── rx.coincidence.md │ │ ├── rx.complete.md │ │ ├── rx.experimental.md │ │ ├── rx.joinpatterns.md │ │ ├── rx.md │ │ ├── rx.testing.md │ │ ├── rx.time.md │ │ └── rx.virtualtime.md │ ├── mapping/ │ │ ├── async/ │ │ │ ├── comparing.md │ │ │ └── whyrx.md │ │ ├── bacon.js/ │ │ │ ├── comparing.md │ │ │ └── whyrx.md │ │ └── highland/ │ │ ├── comparing.md │ │ └── whyrx.md │ └── readme.md ├── examples/ │ ├── alphabetinvasion/ │ │ ├── alphabetinvasion.html │ │ ├── alphabetinvasion.js │ │ ├── main.css │ │ └── readme.md │ ├── animationtest/ │ │ ├── index.html │ │ ├── index.js │ │ └── readme.md │ ├── assets/ │ │ ├── bootstrap/ │ │ │ ├── css/ │ │ │ │ ├── bootstrap-responsive.css │ │ │ │ └── bootstrap.css │ │ │ └── js/ │ │ │ └── bootstrap.js │ │ └── d3/ │ │ ├── LICENSE │ │ └── d3.js │ ├── autocomplete/ │ │ ├── autocomplete.html │ │ ├── autocomplete.js │ │ └── readme.md │ ├── backpressure/ │ │ ├── index.html │ │ ├── index.js │ │ └── readme.md │ ├── canvaspaint/ │ │ ├── canvaspaint.css │ │ ├── canvaspaint.html │ │ ├── canvaspaint.js │ │ ├── excanvas_src.js │ │ └── readme.md │ ├── community.md │ ├── crop/ │ │ ├── crop.css │ │ ├── crop.html │ │ ├── crop.js │ │ ├── images/ │ │ │ └── attribution.txt │ │ ├── readme.md │ │ └── requestanimationframescheduler.js │ ├── d3/ │ │ ├── index.css │ │ ├── index.html │ │ ├── index.js │ │ └── readme.md │ ├── databinding/ │ │ ├── binding.css │ │ ├── binding.html │ │ ├── binding.js │ │ └── readme.md │ ├── dragndrop/ │ │ ├── dragndrop.css │ │ ├── dragndrop.html │ │ ├── dragndrop.js │ │ └── readme.md │ ├── followthemouse/ │ │ ├── followthemouse.css │ │ ├── followthemouse.html │ │ ├── followthemouse.js │ │ └── readme.md │ ├── keyboard-shortcuts/ │ │ ├── app.js │ │ ├── keyCodeMap.js │ │ ├── keyboard-shortcuts.html │ │ ├── keyboard-shortcuts.js │ │ └── readme.md │ ├── konamicode/ │ │ ├── konamicode.html │ │ ├── konamicode.js │ │ └── readme.md │ ├── letterrcount/ │ │ ├── lettercount.css │ │ ├── lettercount.html │ │ ├── lettercount.js │ │ └── readme.md │ ├── longstacktraces/ │ │ ├── longstacktraces.html │ │ └── readme.md │ ├── mario/ │ │ ├── index.css │ │ ├── index.html │ │ ├── index.js │ │ ├── polyfills.js │ │ └── readme.md │ ├── pacman-unicode/ │ │ ├── index.html │ │ ├── index.js │ │ ├── main.css │ │ ├── pacman.js │ │ ├── readme.md │ │ └── unicodetiles/ │ │ ├── input.js │ │ ├── unicodetiles.css │ │ ├── unicodetiles.js │ │ ├── ut.CanvasRenderer.js │ │ ├── ut.DOMRenderer.js │ │ └── ut.WebGLRenderer.js │ ├── presentations.md │ ├── readme.md │ ├── requirejs/ │ │ ├── js/ │ │ │ ├── app/ │ │ │ │ └── main.js │ │ │ ├── app.js │ │ │ └── lib/ │ │ │ └── require.js │ │ ├── readme.md │ │ └── require-example.html │ ├── simpledatabinding/ │ │ ├── readme.md │ │ ├── simpledatabinding.html │ │ └── simpledatabinding.js │ ├── speech/ │ │ ├── readme.md │ │ ├── speech.html │ │ └── speech.js │ ├── stockserver/ │ │ ├── AAPL.csv │ │ ├── AMZN.csv │ │ ├── CSCO.csv │ │ ├── DELL.csv │ │ ├── EMC.csv │ │ ├── F.csv │ │ ├── GE.csv │ │ ├── GOOG.csv │ │ ├── HP.csv │ │ ├── IBM.csv │ │ ├── MSFT.csv │ │ ├── ORCL.csv │ │ ├── RHT.csv │ │ ├── YHOO.csv │ │ ├── fileserver.js │ │ ├── index.js │ │ └── readme.md │ ├── tessel/ │ │ ├── blinky.js │ │ └── readme.md │ ├── testing/ │ │ ├── jasmine/ │ │ │ ├── SpecRunner.html │ │ │ ├── lib/ │ │ │ │ └── jasmine-1.3.1/ │ │ │ │ ├── MIT.LICENSE │ │ │ │ ├── jasmine-html.js │ │ │ │ ├── jasmine.css │ │ │ │ └── jasmine.js │ │ │ └── spec/ │ │ │ ├── SelectSpec.js │ │ │ └── SpecHelper.js │ │ ├── nodejs/ │ │ │ ├── collectionassert.js │ │ │ └── tests.js │ │ ├── qunit/ │ │ │ ├── customassertions.js │ │ │ ├── qunit.css │ │ │ ├── qunit.js │ │ │ ├── tests.html │ │ │ └── tests.js │ │ └── readme.md │ ├── timeflies/ │ │ ├── readme.md │ │ ├── timeflies.css │ │ ├── timeflies.html │ │ └── timeflies.js │ ├── videos.md │ ├── worzone/ │ │ ├── asciigraphic.js │ │ ├── audio/ │ │ │ ├── explosion.ogg │ │ │ ├── fire.ogg │ │ │ ├── intro1.ogg │ │ │ ├── intro2.ogg │ │ │ ├── join1.ogg │ │ │ ├── join2.ogg │ │ │ ├── move1.ogg │ │ │ ├── move2.ogg │ │ │ └── move3.ogg │ │ ├── audio.js │ │ ├── figureimage.js │ │ ├── index.css │ │ ├── index.html │ │ ├── index.js │ │ ├── keyboard.js │ │ ├── lib/ │ │ │ └── raphael-min.js │ │ ├── maze.js │ │ ├── readme.md │ │ ├── rectangle.js │ │ ├── rx.dom.lite.js │ │ └── vector.js │ └── wsh/ │ ├── example1.js │ └── readme.md ├── index.js ├── lib/ │ ├── anonymousobserver.js │ ├── anonymoussafeobserver.js │ ├── concurrency/ │ │ ├── queuescheduler.js │ │ └── scheduler.js │ ├── disposables/ │ │ ├── binarydisposable.js │ │ ├── compositedisposable.js │ │ ├── disposable.js │ │ └── singleassignmentdisposable.js │ ├── internal/ │ │ ├── errors.js │ │ ├── isfunction.js │ │ ├── noop.js │ │ ├── priorityqueue.js │ │ ├── producer.js │ │ ├── safeobserver.js │ │ ├── sink.js │ │ └── throwerror.js │ ├── observable.js │ ├── observablebase.js │ └── observerbase.js ├── license.txt ├── modules/ │ ├── publish.js │ ├── rx-core/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.core.js │ ├── rx-core-binding/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.core.binding.js │ ├── rx-core-testing/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.core.testing.js │ ├── rx-lite/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.js │ ├── rx-lite-aggregates/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.aggregates.js │ ├── rx-lite-aggregates-compat/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.aggregates.compat.js │ ├── rx-lite-async/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.async.js │ ├── rx-lite-async-compat/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.async.compat.js │ ├── rx-lite-backpressure/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.backpressure.js │ ├── rx-lite-backpressure-compat/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.backpressure.compat.js │ ├── rx-lite-coincidence/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.coincidence.js │ ├── rx-lite-coincidence-compat/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.coincidence.compat.js │ ├── rx-lite-compat/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.compat.js │ ├── rx-lite-experimental/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.experimental.js │ ├── rx-lite-experimental-compat/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.experimental.compat.js │ ├── rx-lite-extras/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.extras.js │ ├── rx-lite-extras-compat/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.extras.compat.js │ ├── rx-lite-joinpatterns/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.joinpatterns.js │ ├── rx-lite-joinpatterns-compat/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.joinpatterns.compat.js │ ├── rx-lite-testing/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.testing.js │ ├── rx-lite-testing-compat/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.testing.compat.js │ ├── rx-lite-time/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.time.js │ ├── rx-lite-time-compat/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.time.compat.js │ ├── rx-lite-virtualtime/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.virtualtime.js │ ├── rx-lite-virtualtime-compat/ │ │ ├── package.json │ │ ├── readme.md │ │ └── rx.lite.virtualtime.compat.js │ └── version.js ├── nuget/ │ ├── RxJS-Aggregates/ │ │ └── RxJS-Aggregates.nuspec │ ├── RxJS-All/ │ │ └── RxJS-All.nuspec │ ├── RxJS-Async/ │ │ └── RxJS-Async.nuspec │ ├── RxJS-BackPressure/ │ │ └── RxJS-BackPressure.nuspec │ ├── RxJS-Binding/ │ │ └── RxJS-Binding.nuspec │ ├── RxJS-Coincidence/ │ │ └── RxJS-Coincidence.nuspec │ ├── RxJS-Complete/ │ │ └── RxJS-Complete.nuspec │ ├── RxJS-Experimental/ │ │ └── RxJS-Experimental.nuspec │ ├── RxJS-JoinPatterns/ │ │ └── RxJS-JoinPatterns.nuspec │ ├── RxJS-Lite/ │ │ └── RxJS-Lite.nuspec │ ├── RxJS-Main/ │ │ └── RxJS-Main.nuspec │ ├── RxJS-Testing/ │ │ └── RxJS-Testing.nuspec │ ├── RxJS-Time/ │ │ └── RxJS-Time.nuspec │ └── RxJS-VirtualTime/ │ └── RxJS-VirtualTime.nuspec ├── package.json ├── readme.md ├── src/ │ ├── core/ │ │ ├── abstractobserver.js │ │ ├── anonymousobservable.js │ │ ├── anonymousobserver.js │ │ ├── autodetachobserver.js │ │ ├── backpressure/ │ │ │ ├── controlled.js │ │ │ ├── pausable.js │ │ │ ├── pausablebuffered.js │ │ │ ├── pauser.js │ │ │ ├── stopandwait.js │ │ │ └── windowed.js │ │ ├── checkedobserver.js │ │ ├── concurrency/ │ │ │ ├── catchscheduler.js │ │ │ ├── currentthreadscheduler.js │ │ │ ├── defaultscheduler.js │ │ │ ├── historicalscheduler.js │ │ │ ├── immediatescheduler.js │ │ │ ├── scheduleditem.js │ │ │ ├── scheduleperiodicrecursive.js │ │ │ ├── scheduler.js │ │ │ ├── scheduler.periodic.js │ │ │ ├── scheduler.recursive.js │ │ │ ├── scheduler.wrappers.js │ │ │ └── virtualtimescheduler.js │ │ ├── disposables/ │ │ │ ├── binarydisposable.js │ │ │ ├── booleandisposable.js │ │ │ ├── compositedisposable.js │ │ │ ├── disposable.js │ │ │ ├── refcountdisposable.js │ │ │ └── scheduleddisposable.js │ │ ├── enumerable.js │ │ ├── expressions/ │ │ │ ├── ExpressionTrees.csproj │ │ │ ├── ExpressionTrees.csproj.user │ │ │ ├── ExpressionTrees.sln │ │ │ ├── app.css │ │ │ ├── app.js │ │ │ ├── app.ts │ │ │ ├── compiler.js │ │ │ ├── compiler.ts │ │ │ ├── index.html │ │ │ ├── web.Debug.config │ │ │ ├── web.Release.config │ │ │ └── web.config │ │ ├── headers/ │ │ │ ├── aggregatesheader.js │ │ │ ├── asyncheader.js │ │ │ ├── asyncintro.js │ │ │ ├── backpressureheader.js │ │ │ ├── basicheader-compat.js │ │ │ ├── basicheader.js │ │ │ ├── bindingheader.js │ │ │ ├── coincidenceheader.js │ │ │ ├── core-bindingheader.js │ │ │ ├── core-intro.js │ │ │ ├── core-testheader.js │ │ │ ├── coreheader.js │ │ │ ├── enumeratorheader.js │ │ │ ├── experimentalheader.js │ │ │ ├── exports.js │ │ │ ├── intro.js │ │ │ ├── joinpatternsheader.js │ │ │ ├── license.js │ │ │ ├── liteextrasheader.js │ │ │ ├── liteheader-compat.js │ │ │ ├── liteheader.js │ │ │ ├── liteintro-compat.js │ │ │ ├── liteintro.js │ │ │ ├── litetestintro-compat.js │ │ │ ├── litetestintro.js │ │ │ ├── outro.js │ │ │ ├── sortingheader.js │ │ │ ├── subintro.js │ │ │ ├── suboutro.js │ │ │ ├── testheader.js │ │ │ ├── testintro.js │ │ │ ├── timeheader.js │ │ │ └── virtualtimeheader.js │ │ ├── internal/ │ │ │ ├── bindcallback.js │ │ │ ├── dontenums.js │ │ │ ├── errors.js │ │ │ ├── isequal.js │ │ │ ├── map.js │ │ │ ├── polyfills.js │ │ │ ├── priorityqueue.js │ │ │ ├── trycatch.js │ │ │ └── util.js │ │ ├── joins/ │ │ │ ├── activeplan.js │ │ │ ├── joinobserver.js │ │ │ ├── pattern.js │ │ │ └── plan.js │ │ ├── linq/ │ │ │ ├── connectableobservable.js │ │ │ ├── enumerable/ │ │ │ │ └── while.js │ │ │ ├── groupedobservable.js │ │ │ └── observable/ │ │ │ ├── _extremaby.js │ │ │ ├── _findvalue.js │ │ │ ├── _firstonly.js │ │ │ ├── _observabletimer.js │ │ │ ├── _observabletimerdateandperiod.js │ │ │ ├── _observabletimertimespanandperiod.js │ │ │ ├── amb.js │ │ │ ├── ambproto.js │ │ │ ├── and.js │ │ │ ├── asobservable.js │ │ │ ├── average.js │ │ │ ├── buffer.js │ │ │ ├── bufferwithcount.js │ │ │ ├── bufferwithtime.js │ │ │ ├── bufferwithtimeorcount.js │ │ │ ├── case.js │ │ │ ├── catch.js │ │ │ ├── catchproto.js │ │ │ ├── combinelatestproto.js │ │ │ ├── concatall.js │ │ │ ├── concatmap.js │ │ │ ├── concatmapobserver.js │ │ │ ├── concatproto.js │ │ │ ├── count.js │ │ │ ├── create.js │ │ │ ├── debounce.js │ │ │ ├── defaultifempty.js │ │ │ ├── defer.js │ │ │ ├── delay.js │ │ │ ├── delaysubscription.js │ │ │ ├── dematerialize.js │ │ │ ├── distinct.js │ │ │ ├── dowhile.js │ │ │ ├── elementat.js │ │ │ ├── every.js │ │ │ ├── expand.js │ │ │ ├── find.js │ │ │ ├── findindex.js │ │ │ ├── first.js │ │ │ ├── for.js │ │ │ ├── forkjoin.js │ │ │ ├── forkjoinproto.js │ │ │ ├── fromevent.js │ │ │ ├── fromeventpattern.js │ │ │ ├── generate.js │ │ │ ├── generatewithabsolutetime.js │ │ │ ├── generatewithrelativetime.js │ │ │ ├── groupby.js │ │ │ ├── groupbyuntil.js │ │ │ ├── groupjoin.js │ │ │ ├── if.js │ │ │ ├── includes.js │ │ │ ├── indexof.js │ │ │ ├── interval.js │ │ │ ├── isempty.js │ │ │ ├── join.js │ │ │ ├── jortsort.js │ │ │ ├── jortsortuntil.js │ │ │ ├── last.js │ │ │ ├── lastindexof.js │ │ │ ├── let.js │ │ │ ├── manyselect.js │ │ │ ├── materialize.js │ │ │ ├── max.js │ │ │ ├── maxby.js │ │ │ ├── merge.js │ │ │ ├── mergedelayerror.js │ │ │ ├── min.js │ │ │ ├── minby.js │ │ │ ├── multicast.js │ │ │ ├── observeon.js │ │ │ ├── ofarraychanges.js │ │ │ ├── ofobjectchanges.js │ │ │ ├── onerrorresumenext.js │ │ │ ├── onerrorresumenextproto.js │ │ │ ├── pairwise.js │ │ │ ├── partition.js │ │ │ ├── pipe.js │ │ │ ├── pluck.js │ │ │ ├── publish.js │ │ │ ├── publishlast.js │ │ │ ├── publishvalue.js │ │ │ ├── repeatproto.js │ │ │ ├── repeatwhen.js │ │ │ ├── replay.js │ │ │ ├── retry.js │ │ │ ├── retrywhen.js │ │ │ ├── sample.js │ │ │ ├── selectmanyobserver.js │ │ │ ├── sequenceequal.js │ │ │ ├── share.js │ │ │ ├── sharereplay.js │ │ │ ├── sharevalue.js │ │ │ ├── single.js │ │ │ ├── singleinstance.js │ │ │ ├── skiplast.js │ │ │ ├── skiplastwithtime.js │ │ │ ├── skipuntilwithtime.js │ │ │ ├── skipwhile.js │ │ │ ├── skipwithtime.js │ │ │ ├── slice.js │ │ │ ├── some.js │ │ │ ├── spawn.js │ │ │ ├── start.js │ │ │ ├── startasync.js │ │ │ ├── startwith.js │ │ │ ├── subscribeon.js │ │ │ ├── sum.js │ │ │ ├── switchfirst.js │ │ │ ├── takelast.js │ │ │ ├── takelastbuffer.js │ │ │ ├── takelastbufferwithtime.js │ │ │ ├── takelastwithtime.js │ │ │ ├── takeuntilwithtime.js │ │ │ ├── takewhile.js │ │ │ ├── takewithtime.js │ │ │ ├── thendo.js │ │ │ ├── throttle.js │ │ │ ├── timeinterval.js │ │ │ ├── timeout.js │ │ │ ├── timer.js │ │ │ ├── timestamp.js │ │ │ ├── toasync.js │ │ │ ├── tomap.js │ │ │ ├── topromise.js │ │ │ ├── toset.js │ │ │ ├── transduce.js │ │ │ ├── using.js │ │ │ ├── when.js │ │ │ ├── while.js │ │ │ ├── window.js │ │ │ ├── windowwithcount.js │ │ │ ├── windowwithtime.js │ │ │ ├── windowwithtimeorcount.js │ │ │ ├── zip.js │ │ │ └── zipiterable.js │ │ ├── longstacktraces/ │ │ │ ├── longstackbegin.js │ │ │ ├── longstackend.js │ │ │ └── longstacktraces.js │ │ ├── notification.js │ │ ├── observable.js │ │ ├── observeonobserver.js │ │ ├── observer-extras.js │ │ ├── observer-lite.js │ │ ├── observer.js │ │ ├── perf/ │ │ │ ├── observablebase.js │ │ │ └── operators/ │ │ │ ├── combinelatest.js │ │ │ ├── concat.js │ │ │ ├── concatmap.js │ │ │ ├── distinctuntilchanged.js │ │ │ ├── empty.js │ │ │ ├── filter.js │ │ │ ├── finally.js │ │ │ ├── flatmap.js │ │ │ ├── flatmapbase.js │ │ │ ├── flatmapfirst.js │ │ │ ├── flatmaplatest.js │ │ │ ├── flatmapwithmaxconcurrent.js │ │ │ ├── from.js │ │ │ ├── fromarray.js │ │ │ ├── fromarrayobservable.js │ │ │ ├── fromcallback.js │ │ │ ├── fromnodecallback.js │ │ │ ├── frompromise.js │ │ │ ├── ignoreelements.js │ │ │ ├── just.js │ │ │ ├── map.js │ │ │ ├── mergeall.js │ │ │ ├── mergeconcat.js │ │ │ ├── never.js │ │ │ ├── of.js │ │ │ ├── pairs.js │ │ │ ├── range.js │ │ │ ├── reduce.js │ │ │ ├── repeat.js │ │ │ ├── scan.js │ │ │ ├── skip.js │ │ │ ├── skipuntil.js │ │ │ ├── switch.js │ │ │ ├── take.js │ │ │ ├── takeuntil.js │ │ │ ├── tap.js │ │ │ ├── throw.js │ │ │ ├── toarray.js │ │ │ ├── withlatestfrom.js │ │ │ └── zip.js │ │ ├── scheduledobserver.js │ │ ├── subjects/ │ │ │ ├── anonymoussubject.js │ │ │ ├── asyncsubject.js │ │ │ ├── behaviorsubject.js │ │ │ ├── innersubscription.js │ │ │ ├── replaysubject.js │ │ │ └── subject.js │ │ └── testing/ │ │ ├── coldobservable.js │ │ ├── hotobservable.js │ │ ├── mockdisposable.js │ │ ├── mockobserver.js │ │ ├── mockpromise.js │ │ ├── reactivetest.js │ │ ├── recorded.js │ │ ├── subscription.js │ │ └── testscheduler.js │ └── modular/ │ ├── asyncsubject.js │ ├── behaviorsubject.js │ ├── binarydisposable.js │ ├── compositedisposable.js │ ├── disposable.js │ ├── dist/ │ │ ├── rx.all.js │ │ └── rx.lite.js │ ├── helpers/ │ │ ├── comparer.js │ │ ├── identity.js │ │ ├── isarraylike.js │ │ ├── isfunction.js │ │ ├── isiterable.js │ │ ├── ispromise.js │ │ ├── iterator.js │ │ └── noop.js │ ├── index.js │ ├── internal/ │ │ ├── addproperties.js │ │ ├── addref.js │ │ ├── bindcallback.js │ │ ├── clonearray.js │ │ ├── errors.js │ │ ├── innersubscription.js │ │ ├── isequal.js │ │ ├── priorityqueue.js │ │ └── trycatchutils.js │ ├── joins/ │ │ ├── activeplan.js │ │ ├── joinobserver.js │ │ ├── pattern.js │ │ └── plan.js │ ├── narydisposable.js │ ├── notification.js │ ├── observable/ │ │ ├── _extremabyobservable.js │ │ ├── _findvalueobservable.js │ │ ├── _firstonly.js │ │ ├── and.js │ │ ├── anonymousobservable.js │ │ ├── asobservable.js │ │ ├── average.js │ │ ├── bindcallback.js │ │ ├── bindnodecallback.js │ │ ├── buffer.js │ │ ├── buffercount.js │ │ ├── buffertime.js │ │ ├── buffertimeorcount.js │ │ ├── case.js │ │ ├── catch.js │ │ ├── catchhandler.js │ │ ├── combinelatest.js │ │ ├── concat.js │ │ ├── concatall.js │ │ ├── connectableobservable.js │ │ ├── controlled.js │ │ ├── count.js │ │ ├── create.js │ │ ├── debounce.js │ │ ├── defaultifempty.js │ │ ├── defer.js │ │ ├── delay.js │ │ ├── delaysubscription.js │ │ ├── dematerialize.js │ │ ├── distinct.js │ │ ├── distinctuntilchanged.js │ │ ├── empty.js │ │ ├── every.js │ │ ├── filter.js │ │ ├── finally.js │ │ ├── find.js │ │ ├── findindex.js │ │ ├── first.js │ │ ├── flatmap.js │ │ ├── flatmapfirst.js │ │ ├── flatmaplatest.js │ │ ├── flatmapmaxconcurrent.js │ │ ├── flatmapobservable.js │ │ ├── forkjoin.js │ │ ├── from.js │ │ ├── fromarray.js │ │ ├── fromevent.js │ │ ├── fromeventpattern.js │ │ ├── frompromise.js │ │ ├── generate.js │ │ ├── generateabsolute.js │ │ ├── generaterelative.js │ │ ├── groupjoin.js │ │ ├── ignoreelements.js │ │ ├── includes.js │ │ ├── indexof.js │ │ ├── interval.js │ │ ├── isempty.js │ │ ├── join.js │ │ ├── just.js │ │ ├── last.js │ │ ├── lastindexof.js │ │ ├── map.js │ │ ├── materialize.js │ │ ├── max.js │ │ ├── maxby.js │ │ ├── merge.js │ │ ├── mergeall.js │ │ ├── mergeconcat.js │ │ ├── mergedelayerror.js │ │ ├── min.js │ │ ├── minby.js │ │ ├── multicast.js │ │ ├── never.js │ │ ├── observablebase.js │ │ ├── observeon.js │ │ ├── of.js │ │ ├── ofscheduled.js │ │ ├── onerrorresumenext.js │ │ ├── pairs.js │ │ ├── pairwise.js │ │ ├── partition.js │ │ ├── pausable.js │ │ ├── pausablebuffered.js │ │ ├── pluck.js │ │ ├── publish.js │ │ ├── publishlast.js │ │ ├── publishvalue.js │ │ ├── race.js │ │ ├── range.js │ │ ├── reduce.js │ │ ├── repeat.js │ │ ├── repeatvalue.js │ │ ├── repeatwhen.js │ │ ├── replay.js │ │ ├── retry.js │ │ ├── retrywhen.js │ │ ├── sample.js │ │ ├── scan.js │ │ ├── sequenceequal.js │ │ ├── share.js │ │ ├── sharereplay.js │ │ ├── sharevalue.js │ │ ├── skip.js │ │ ├── skiplast.js │ │ ├── skiplastwithtime.js │ │ ├── skipuntil.js │ │ ├── skipuntilwithtime.js │ │ ├── skipwhile.js │ │ ├── skipwithtime.js │ │ ├── slice.js │ │ ├── some.js │ │ ├── start.js │ │ ├── startasync.js │ │ ├── startwith.js │ │ ├── stopandwait.js │ │ ├── subscribeon.js │ │ ├── sum.js │ │ ├── switch.js │ │ ├── switchfirst.js │ │ ├── take.js │ │ ├── takelast.js │ │ ├── takelastbuffer.js │ │ ├── takelastbufferwithtime.js │ │ ├── takelastwithtime.js │ │ ├── takeuntil.js │ │ ├── takeuntilwithtime.js │ │ ├── takewhile.js │ │ ├── tap.js │ │ ├── thendo.js │ │ ├── throttle.js │ │ ├── throw.js │ │ ├── timeinterval.js │ │ ├── timer.js │ │ ├── timestamp.js │ │ ├── toarray.js │ │ ├── toasync.js │ │ ├── tomap.js │ │ ├── topromise.js │ │ ├── toset.js │ │ ├── transduce.js │ │ ├── using.js │ │ ├── when.js │ │ ├── window.js │ │ ├── windowcount.js │ │ ├── windowed.js │ │ ├── windowtime.js │ │ ├── windowtimeorcount.js │ │ ├── withlatestfrom.js │ │ ├── zip.js │ │ └── zipiterable.js │ ├── observable.js │ ├── observer/ │ │ ├── abstractobserver.js │ │ ├── anonymousobserver.js │ │ ├── asobserver.js │ │ ├── autodetachobserver.js │ │ ├── checked.js │ │ ├── checkedobserver.js │ │ ├── create.js │ │ ├── fromnotifier.js │ │ ├── makesafe.js │ │ ├── notifyon.js │ │ ├── observeonobserver.js │ │ ├── scheduledobserver.js │ │ └── tonotifier.js │ ├── observer.js │ ├── package.json │ ├── readme.md │ ├── refcountdisposable.js │ ├── replaysubject.js │ ├── rx.lite.js │ ├── scheduleddisposable.js │ ├── scheduler/ │ │ ├── catchscheduler.js │ │ ├── currentthreadscheduler.js │ │ ├── defaultscheduler.js │ │ ├── historicalscheduler.js │ │ ├── immediatescheduler.js │ │ ├── scheduleditem.js │ │ ├── scheduleperiodicrecursive.js │ │ └── virtualtimescheduler.js │ ├── scheduler.js │ ├── serialdisposable.js │ ├── singleassignmentdisposable.js │ ├── subject/ │ │ └── create.js │ ├── subject.js │ ├── test/ │ │ ├── asyncsubject.js │ │ ├── average.js │ │ ├── behaviorsubject.js │ │ ├── binarydisposable.js │ │ ├── bindcallback.js │ │ ├── bindnodecallback.js │ │ ├── buffer.js │ │ ├── buffercount.js │ │ ├── buffertime.js │ │ ├── buffertimeorcount.js │ │ ├── case.js │ │ ├── catch.js │ │ ├── catchhandler.js │ │ ├── combinelatest.js │ │ ├── compositedisposable.js │ │ ├── concat.js │ │ ├── connectableobservable.js │ │ ├── controlled.js │ │ ├── count.js │ │ ├── create.js │ │ ├── currentthreadscheduler.js │ │ ├── debounce.js │ │ ├── defaultifempty.js │ │ ├── defaultscheduler.js │ │ ├── defer.js │ │ ├── delay.js │ │ ├── delaysubscription.js │ │ ├── disposable.js │ │ ├── distinct.js │ │ ├── distinctuntilchanged.js │ │ ├── empty.js │ │ ├── every.js │ │ ├── filter.js │ │ ├── finally.js │ │ ├── find.js │ │ ├── findindex.js │ │ ├── first.js │ │ ├── flatmap.js │ │ ├── forkjoin.js │ │ ├── from.js │ │ ├── fromarray.js │ │ ├── fromevent.js │ │ ├── fromeventpattern.js │ │ ├── frompromise.js │ │ ├── generate.js │ │ ├── generateabsolute.js │ │ ├── generaterelative.js │ │ ├── groupjoin.js │ │ ├── historicalscheduler.js │ │ ├── ignoreelements.js │ │ ├── includes.js │ │ ├── indexof.js │ │ ├── interval.js │ │ ├── isempty.js │ │ ├── isequal.js │ │ ├── join.js │ │ ├── just.js │ │ ├── last.js │ │ ├── lastindexof.js │ │ ├── map.js │ │ ├── materialize.js │ │ ├── max.js │ │ ├── maxby.js │ │ ├── merge.js │ │ ├── mergeall.js │ │ ├── mergeconcat.js │ │ ├── mergedelayerror.js │ │ ├── min.js │ │ ├── minby.js │ │ ├── multicast.js │ │ ├── narydisposable.js │ │ ├── never.js │ │ ├── notification.js │ │ ├── observeon.js │ │ ├── observer.js │ │ ├── of.js │ │ ├── onerrorresumenext.js │ │ ├── pairs.js │ │ ├── pairwise.js │ │ ├── partition.js │ │ ├── pausable.js │ │ ├── pausablebuffered.js │ │ ├── pluck.js │ │ ├── publish.js │ │ ├── publishlast.js │ │ ├── publishvalue.js │ │ ├── race.js │ │ ├── range.js │ │ ├── reduce.js │ │ ├── refcountdisposable.js │ │ ├── repeat.js │ │ ├── repeatwhen.js │ │ ├── replay.js │ │ ├── replaysubject.js │ │ ├── retry.js │ │ ├── retrywhen.js │ │ ├── sample.js │ │ ├── scan.js │ │ ├── scheduler.js │ │ ├── sequenceequal.js │ │ ├── serialdisposable.js │ │ ├── singleassignmentdisposable.js │ │ ├── skip.js │ │ ├── skiplast.js │ │ ├── skiplastwithtime.js │ │ ├── skipuntil.js │ │ ├── skipuntilwithtime.js │ │ ├── skipwhile.js │ │ ├── skipwithtime.js │ │ ├── slice.js │ │ ├── some.js │ │ ├── start.js │ │ ├── startwith.js │ │ ├── stopandwait.js │ │ ├── subject.js │ │ ├── subscribeon.js │ │ ├── sum.js │ │ ├── switch.js │ │ ├── switchfirst.js │ │ ├── take.js │ │ ├── takelast.js │ │ ├── takelastbuffer.js │ │ ├── takelastbufferwithtime.js │ │ ├── takelastwithtime.js │ │ ├── takeuntil.js │ │ ├── takeuntilwithtime.js │ │ ├── takewhile.js │ │ ├── tap.js │ │ ├── throttle.js │ │ ├── throw.js │ │ ├── timeinterval.js │ │ ├── timer.js │ │ ├── timestamp.js │ │ ├── toarray.js │ │ ├── toasync.js │ │ ├── tomap.js │ │ ├── topromise.js │ │ ├── toset.js │ │ ├── transduce.js │ │ ├── using.js │ │ ├── when.js │ │ ├── window.js │ │ ├── windowcount.js │ │ ├── windowed.js │ │ ├── windowtime.js │ │ ├── windowtimeorcount.js │ │ ├── withlatestfrom.js │ │ └── zip.js │ ├── testing/ │ │ ├── coldobservable.js │ │ ├── hotobservable.js │ │ ├── mockdisposable.js │ │ ├── mockobserver.js │ │ ├── mockpromise.js │ │ ├── reactiveassert.js │ │ ├── reactivetest.js │ │ ├── recorded.js │ │ ├── subscription.js │ │ └── testscheduler.js │ ├── webpack.config.js │ └── webpack.config.production.js ├── tests/ │ ├── concurrency/ │ │ ├── currentthreadscheduler.js │ │ ├── defaultscheduler.js │ │ ├── historicalscheduler.js │ │ ├── immediatescheduler.js │ │ ├── scheduler-lite.js │ │ ├── scheduler.js │ │ └── virtualtimescheduler.js │ ├── core/ │ │ ├── notification.js │ │ ├── observable.js │ │ ├── observer-extras.js │ │ ├── observer-lite.js │ │ └── observer.js │ ├── disposables/ │ │ ├── compositedisposable.js │ │ ├── disposable.js │ │ ├── refcountdisposable.js │ │ ├── serialdisposable.js │ │ └── singleassignmentdisposable.js │ ├── helpers/ │ │ ├── mockiterable.js │ │ └── reactiveassert.js │ ├── internal/ │ │ ├── isequal.js │ │ └── trycatch.js │ ├── observable/ │ │ ├── amb.js │ │ ├── asobservable.js │ │ ├── average.js │ │ ├── buffer.js │ │ ├── bufferwithcount.js │ │ ├── bufferwithtime.js │ │ ├── bufferwithtimeorcount.js │ │ ├── case.js │ │ ├── catch.js │ │ ├── combinelatest.js │ │ ├── concat.js │ │ ├── concatmap.js │ │ ├── concatmapobserver.js │ │ ├── connectableobservable.js │ │ ├── controlled.js │ │ ├── count.js │ │ ├── create.js │ │ ├── debounce.js │ │ ├── defaultifempty.js │ │ ├── defer.js │ │ ├── delay.js │ │ ├── delaysubscription.js │ │ ├── distinct.js │ │ ├── distinctuntilchanged.js │ │ ├── do.js │ │ ├── dowhile.js │ │ ├── elementat.js │ │ ├── empty.js │ │ ├── every.js │ │ ├── expand.js │ │ ├── finally.js │ │ ├── find.js │ │ ├── findindex.js │ │ ├── first.js │ │ ├── for.js │ │ ├── forkjoin.js │ │ ├── from.js │ │ ├── fromarray.js │ │ ├── fromcallback.js │ │ ├── fromevent.js │ │ ├── fromeventpattern.js │ │ ├── fromnodecallback.js │ │ ├── frompromise.js │ │ ├── generate.js │ │ ├── generatewithabsolutetime.js │ │ ├── generatewithrelativetime.js │ │ ├── groupby.js │ │ ├── groupbyuntil.js │ │ ├── groupjoin.js │ │ ├── if.js │ │ ├── ignoreelements.js │ │ ├── includes.js │ │ ├── indexof.js │ │ ├── interval.js │ │ ├── isempty.js │ │ ├── join.js │ │ ├── jortsort.js │ │ ├── jortsortuntil.js │ │ ├── last.js │ │ ├── lastindexof.js │ │ ├── let.js │ │ ├── manyselect.js │ │ ├── materialize.js │ │ ├── max.js │ │ ├── maxby.js │ │ ├── merge.js │ │ ├── mergeall.js │ │ ├── mergeconcat.js │ │ ├── mergedelayerror.js │ │ ├── min.js │ │ ├── minby.js │ │ ├── multicast.js │ │ ├── never.js │ │ ├── observeon.js │ │ ├── of.js │ │ ├── ofarraychanges.js │ │ ├── ofobjectchanges.js │ │ ├── onerrorresumenext.js │ │ ├── pairs.js │ │ ├── pairwise.js │ │ ├── partition.js │ │ ├── pausable.js │ │ ├── pausablebuffered.js │ │ ├── pluck.js │ │ ├── publish.js │ │ ├── publishlast.js │ │ ├── publishvalue.js │ │ ├── range.js │ │ ├── reduce.js │ │ ├── repeat.js │ │ ├── repeatwhen.js │ │ ├── replay.js │ │ ├── retry.js │ │ ├── retrywhen.js │ │ ├── return.js │ │ ├── sample.js │ │ ├── scan.js │ │ ├── select.js │ │ ├── selectmany.js │ │ ├── selectmanyobserver.js │ │ ├── sequenceequal.js │ │ ├── single.js │ │ ├── singleinstance.js │ │ ├── skip.js │ │ ├── skiplast.js │ │ ├── skiplastwithtime.js │ │ ├── skipuntil.js │ │ ├── skipuntilwithtime.js │ │ ├── skipwhile.js │ │ ├── skipwithtime.js │ │ ├── slice.js │ │ ├── some.js │ │ ├── spawn.js │ │ ├── start.js │ │ ├── startwith.js │ │ ├── subscribeon.js │ │ ├── sum.js │ │ ├── switch.js │ │ ├── take.js │ │ ├── takelast.js │ │ ├── takelastbuffer.js │ │ ├── takelastbufferwithtime.js │ │ ├── takelastwithtime.js │ │ ├── takeuntil.js │ │ ├── takeuntilwithtime.js │ │ ├── takewhile.js │ │ ├── takewithtime.js │ │ ├── throttle.js │ │ ├── throw.js │ │ ├── timeinterval.js │ │ ├── timeout.js │ │ ├── timer.js │ │ ├── timestamp.js │ │ ├── toarray.js │ │ ├── toasync.js │ │ ├── tomap.js │ │ ├── topromise.js │ │ ├── toset.js │ │ ├── transduce.js │ │ ├── using.js │ │ ├── when.js │ │ ├── where.js │ │ ├── while.js │ │ ├── window.js │ │ ├── windowwithcount.js │ │ ├── windowwithtime.js │ │ ├── windowwithtimeorcount.js │ │ ├── withlatestfrom.js │ │ └── zip.js │ ├── perf/ │ │ ├── old/ │ │ │ ├── rx.aggregates.js │ │ │ ├── rx.all.compat.js │ │ │ ├── rx.all.js │ │ │ ├── rx.async.compat.js │ │ │ ├── rx.async.js │ │ │ ├── rx.backpressure.js │ │ │ ├── rx.binding.js │ │ │ ├── rx.coincidence.js │ │ │ ├── rx.compat.js │ │ │ ├── rx.experimental.js │ │ │ ├── rx.joinpatterns.js │ │ │ ├── rx.js │ │ │ ├── rx.lite.compat.js │ │ │ ├── rx.lite.extras.js │ │ │ ├── rx.lite.js │ │ │ ├── rx.sorting.js │ │ │ ├── rx.testing.js │ │ │ ├── rx.time.js │ │ │ └── rx.virtualtime.js │ │ ├── operators/ │ │ │ ├── combinelatest.js │ │ │ ├── concat.js │ │ │ ├── concatmap.js │ │ │ ├── count.js │ │ │ ├── defer.js │ │ │ ├── distinctuntilchanged.js │ │ │ ├── empty.js │ │ │ ├── filter.js │ │ │ ├── finally.js │ │ │ ├── flatmap.js │ │ │ ├── forkjoin.js │ │ │ ├── from.js │ │ │ ├── fromarray.js │ │ │ ├── fromcallback.js │ │ │ ├── fromnodecallback.js │ │ │ ├── frompromise.js │ │ │ ├── ignoreelements.js │ │ │ ├── just.js │ │ │ ├── map.js │ │ │ ├── materialize.js │ │ │ ├── mergeall.js │ │ │ ├── mergeproto.js │ │ │ ├── never.js │ │ │ ├── of.js │ │ │ ├── pairs.js │ │ │ ├── range.js │ │ │ ├── reduce.js │ │ │ ├── repeat.js │ │ │ ├── scan.js │ │ │ ├── skip.js │ │ │ ├── skipuntil.js │ │ │ ├── switch.js │ │ │ ├── take.js │ │ │ ├── takeuntil.js │ │ │ ├── throw.js │ │ │ ├── toarray.js │ │ │ ├── withlatestfrom.js │ │ │ └── zip.js │ │ └── vendor/ │ │ ├── benchmark.js │ │ └── rsvp-latest.js │ ├── rx.aggregates.html │ ├── rx.all.compat.html │ ├── rx.all.html │ ├── rx.async.compat.html │ ├── rx.async.html │ ├── rx.backpressure.html │ ├── rx.binding.html │ ├── rx.coincidence.html │ ├── rx.compat.html │ ├── rx.core.binding.html │ ├── rx.core.html │ ├── rx.experimental.html │ ├── rx.html │ ├── rx.joinpatterns.html │ ├── rx.lite.compat.html │ ├── rx.lite.extras.html │ ├── rx.lite.html │ ├── rx.time.html │ ├── rx.virtualtime.html │ ├── subjects/ │ │ ├── asyncsubject.js │ │ ├── behaviorsubject.js │ │ ├── replaysubject.js │ │ └── subject.js │ └── vendor/ │ ├── es5-shim.js │ ├── es6-shim.js │ ├── qunit-1.11.0.css │ ├── qunit-1.11.0.js │ ├── rsvp.js │ └── transducers-0.4.158-min.js ├── travis.sh └── ts/ ├── core/ │ ├── abstractobserver.ts │ ├── anonymousobservable.ts │ ├── anonymousobserver.ts │ ├── backpressure/ │ │ ├── controlled.ts │ │ ├── pausable.ts │ │ ├── pausablebuffered.ts │ │ ├── pauser.ts │ │ ├── stopandwait.ts │ │ └── windowed.ts │ ├── checkedobserver.ts │ ├── concurrency/ │ │ ├── currentthreadscheduler.ts │ │ ├── defaultscheduler.ts │ │ ├── historicalscheduler.ts │ │ ├── immediatescheduler.ts │ │ ├── scheduleditem.ts │ │ ├── scheduleperiodicrecursive.ts │ │ ├── scheduler.periodic.ts │ │ ├── scheduler.recursive.ts │ │ ├── scheduler.ts │ │ ├── scheduler.wrappers.ts │ │ └── virtualtimescheduler.ts │ ├── disposables/ │ │ ├── booleandisposable.ts │ │ ├── compositedisposable.ts │ │ ├── disposable.ts │ │ └── refcountdisposable.ts │ ├── es5.ts │ ├── es6-iterable.d.ts │ ├── es6-promise.d.ts │ ├── es6.ts │ ├── internal/ │ │ ├── bindcallback.ts │ │ ├── errors.ts │ │ ├── isequal.ts │ │ ├── priorityqueue.ts │ │ └── util.ts │ ├── joins/ │ │ ├── pattern.ts │ │ └── plan.ts │ ├── linq/ │ │ ├── connectableobservable.ts │ │ ├── groupedobservable.ts │ │ └── observable/ │ │ ├── amb.ts │ │ ├── ambproto.ts │ │ ├── and.ts │ │ ├── asobservable.ts │ │ ├── average.ts │ │ ├── buffer.ts │ │ ├── bufferwithcount.ts │ │ ├── bufferwithtime.ts │ │ ├── bufferwithtimeorcount.ts │ │ ├── case.ts │ │ ├── catch.ts │ │ ├── catchproto.ts │ │ ├── combinelatest.ts │ │ ├── combinelatestproto.ts │ │ ├── concat.ts │ │ ├── concatall.ts │ │ ├── concatmap.ts │ │ ├── concatmapobserver.ts │ │ ├── concatproto.ts │ │ ├── count.ts │ │ ├── create.ts │ │ ├── debounce.ts │ │ ├── defaultifempty.ts │ │ ├── defer.ts │ │ ├── delay.ts │ │ ├── delaysubscription.ts │ │ ├── dematerialize.ts │ │ ├── distinct.ts │ │ ├── distinctuntilchanged.ts │ │ ├── dowhile.ts │ │ ├── elementat.ts │ │ ├── empty.ts │ │ ├── every.ts │ │ ├── expand.ts │ │ ├── filter.ts │ │ ├── finally.ts │ │ ├── find.ts │ │ ├── findindex.ts │ │ ├── first.ts │ │ ├── flatmap.ts │ │ ├── flatmapfirst.ts │ │ ├── flatmaplatest.ts │ │ ├── flatmapwithmaxconcurrent.ts │ │ ├── for.ts │ │ ├── forkjoin.ts │ │ ├── forkjoinproto.ts │ │ ├── from.ts │ │ ├── fromarray.ts │ │ ├── fromcallback.ts │ │ ├── fromevent.ts │ │ ├── fromeventpattern.ts │ │ ├── fromnodecallback.ts │ │ ├── frompromise.ts │ │ ├── generate.ts │ │ ├── generatewithabsolutetime.ts │ │ ├── generatewithrelativetime.ts │ │ ├── groupby.ts │ │ ├── groupbyuntil.ts │ │ ├── groupjoin.ts │ │ ├── if.ts │ │ ├── ignoreelements.ts │ │ ├── includes.ts │ │ ├── indexof.ts │ │ ├── interval.ts │ │ ├── isempty.ts │ │ ├── join.ts │ │ ├── jortsort.ts │ │ ├── jortsortuntil.ts │ │ ├── just.ts │ │ ├── last.ts │ │ ├── let.ts │ │ ├── manyselect.ts │ │ ├── map.ts │ │ ├── materialize.ts │ │ ├── max.ts │ │ ├── maxby.ts │ │ ├── merge.ts │ │ ├── mergeall.ts │ │ ├── mergeconcat.ts │ │ ├── mergedelayerror.ts │ │ ├── min.ts │ │ ├── minby.ts │ │ ├── multicast.ts │ │ ├── never.ts │ │ ├── observeon.ts │ │ ├── of.ts │ │ ├── ofarraychanges.ts │ │ ├── ofobjectchanges.ts │ │ ├── onerrorresumenext.ts │ │ ├── onerrorresumenextproto.ts │ │ ├── pairs.ts │ │ ├── pairwise.ts │ │ ├── partition.ts │ │ ├── pipe.ts │ │ ├── pluck.ts │ │ ├── publish.ts │ │ ├── publishlast.ts │ │ ├── publishvalue.ts │ │ ├── range.ts │ │ ├── reduce.ts │ │ ├── repeat.ts │ │ ├── repeatproto.ts │ │ ├── replay.ts │ │ ├── retry.ts │ │ ├── retrywhen.ts │ │ ├── sample.ts │ │ ├── scan.ts │ │ ├── selectmanyobserver.ts │ │ ├── sequenceequal.ts │ │ ├── share.ts │ │ ├── sharereplay.ts │ │ ├── sharevalue.ts │ │ ├── single.ts │ │ ├── singleinstance.ts │ │ ├── skip.ts │ │ ├── skiplast.ts │ │ ├── skiplastwithtime.ts │ │ ├── skipuntil.ts │ │ ├── skipuntilwithtime.ts │ │ ├── skipwhile.ts │ │ ├── skipwithtime.ts │ │ ├── some.ts │ │ ├── spawn.ts │ │ ├── start.ts │ │ ├── startasync.ts │ │ ├── startwith.ts │ │ ├── subscribeon.ts │ │ ├── sum.ts │ │ ├── switch.ts │ │ ├── switchfirst.ts │ │ ├── take.ts │ │ ├── takelast.ts │ │ ├── takelastbuffer.ts │ │ ├── takelastbufferwithtime.ts │ │ ├── takelastwithtime.ts │ │ ├── takeuntil.ts │ │ ├── takeuntilwithtime.ts │ │ ├── takewhile.ts │ │ ├── takewithtime.ts │ │ ├── tap.ts │ │ ├── thendo.ts │ │ ├── throttle.ts │ │ ├── throw.ts │ │ ├── timeinterval.ts │ │ ├── timeout.ts │ │ ├── timer.ts │ │ ├── timestamp.ts │ │ ├── toarray.ts │ │ ├── toasync.ts │ │ ├── tomap.ts │ │ ├── topromise.ts │ │ ├── toset.ts │ │ ├── transduce.ts │ │ ├── using.ts │ │ ├── when.ts │ │ ├── while.ts │ │ ├── window.ts │ │ ├── windowwithcount.ts │ │ ├── windowwithtime.ts │ │ ├── windowwithtimeorcount.ts │ │ ├── withlatestfrom.ts │ │ ├── zip.ts │ │ └── zipiterable.ts │ ├── notification.ts │ ├── observable.ts │ ├── observer-extras.ts │ ├── observer-lite.ts │ ├── observer.ts │ ├── scheduledobserver.ts │ ├── subjects/ │ │ ├── anonymoussubject.ts │ │ ├── asyncsubject.ts │ │ ├── behaviorsubject.ts │ │ ├── replaysubject.ts │ │ └── subject.ts │ └── testing/ │ ├── mockdisposable.ts │ ├── mockobserver.ts │ ├── reactivetest.ts │ ├── recorded.ts │ ├── subscription.ts │ └── testscheduler.ts ├── es6-promise.es6.d.ts ├── iterable.es6.d.ts ├── rx.aggregates.d.ts ├── rx.aggregates.es6.d.ts ├── rx.all.d.ts ├── rx.all.es6.d.ts ├── rx.async.d.ts ├── rx.async.es6.d.ts ├── rx.backpressure.d.ts ├── rx.backpressure.es6.d.ts ├── rx.binding.d.ts ├── rx.binding.es6.d.ts ├── rx.coincidence.d.ts ├── rx.coincidence.es6.d.ts ├── rx.core.binding.d.ts ├── rx.core.binding.es6.d.ts ├── rx.core.d.ts ├── rx.core.es6.d.ts ├── rx.core.testing.d.ts ├── rx.core.testing.es6.d.ts ├── rx.d.ts ├── rx.es6.d.ts ├── rx.experimental.d.ts ├── rx.experimental.es6.d.ts ├── rx.joinpatterns.d.ts ├── rx.joinpatterns.es6.d.ts ├── rx.lite.d.ts ├── rx.lite.es6.d.ts ├── rx.lite.extras.d.ts ├── rx.lite.extras.es6.d.ts ├── rx.sorting.d.ts ├── rx.sorting.es6.d.ts ├── rx.testing.d.ts ├── rx.testing.es6.d.ts ├── rx.time.d.ts ├── rx.time.es6.d.ts ├── rx.virtualtime.d.ts ├── rx.virtualtime.es6.d.ts └── tsconfig.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .coveralls.yml ================================================ service_name: travis-pro repo_token: 8YyWggHYCJrQmm4qdV2f5LVvo3vBD7Xsa ================================================ FILE: .editorconfig ================================================ root = true [*] end_of_line = lf insert_final_newline = false indent_style = space indent_size = 2 ================================================ FILE: .gitattributes ================================================ * text eol=lf *.png -text *.exe -text *.jpg -text *.txt -text ================================================ FILE: .gitignore ================================================ .idea/ .DS_Store node_modules npm-debug.log .vscode/ ================================================ FILE: .jamignore ================================================ .* *.bat *.md *.min.* *.txt *.log package.json node_modules doc examples src tests .nuget nuget ================================================ FILE: .jscsrc ================================================ { "excludeFiles": [ "src/core/asyncintro.js", "src/core/intro.js", "src/core/outro.js", "src/core/suboutro.js", "src/core/subintro.js", "src/core/testintro.js" ], "requireCurlyBraces": [ "if", "else", "for", "while", "do", "try", "catch" ], "requireOperatorBeforeLineBreak": true, "requireCamelCaseOrUpperCaseIdentifiers": true, "disallowMultipleLineStrings": true, "disallowMixedSpacesAndTabs": true, "disallowTrailingWhitespace": true, "disallowSpaceAfterPrefixUnaryOperators": true, "requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "return", "try", "catch" ], "requireSpaceBeforeBinaryOperators": [ "=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "&=", "|=", "^=", "+=", "+", "-", "*", "/", "%", "<<", ">>", ">>>", "&", "|", "^", "&&", "||", "===", "==", ">=", "<=", "<", ">", "!=", "!==" ], "requireSpaceAfterBinaryOperators": true, "requireSpacesInConditionalExpression": true, "requireSpaceBeforeBlockStatements": true, "requireLineFeedAtFileEnd": true, "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, "disallowSpacesInsideParentheses": true, "disallowMultipleLineBreaks": true, "disallowNewlineBeforeBlockStatements": true } ================================================ FILE: .jscsrc.todo ================================================ { "maximumLineLength": { "value": 80, "allowComments": true, "allowRegex": true }, "validateIndentation": 2, "validateQuoteMarks": "'", "disallowMultipleVarDecl": true, "disallowSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true }, "disallowSpacesInsideObjectBrackets": "all", "disallowSpacesInsideArrayBrackets": "all", "validateJSDoc": { "checkParamNames": true, "requireParamTypes": true } } ================================================ FILE: .jshintrc ================================================ { "curly": true, "eqeqeq": true, "immed": true, "latedef": true, "newcap": true, "noarg": true, "sub": true, "undef": true, "unused": true, "boss": true, "eqnull": true, "node": true, "-W030": true, "predef": [ "Promise" ] } ================================================ FILE: .npmignore ================================================ node_modules/ modules/ .npm-debug.log .nuget/ .vscode/ nuget/ doc/ examples/ tests/ logos/ modules/ src/ .git* .jshint* .npmignore .travis.yml CHANGELOG.* Gruntfile.js travis.sh ================================================ FILE: .nuget/nuget.config ================================================ ================================================ FILE: .nuget/nuget.targets ================================================ $(MSBuildProjectDirectory)\..\ $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) $([System.IO.Path]::Combine($(SolutionDir), "packages")) $(SolutionDir).nuget packages.config $(SolutionDir)packages $(NuGetToolsPath)\nuget.exe "$(NuGetExePath)" mono --runtime=v4.0.30319 $(NuGetExePath) $(TargetDir.Trim('\\')) "" false false $(NuGetCommand) install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)" $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols RestorePackages; $(BuildDependsOn); $(BuildDependsOn); BuildPackage; ================================================ FILE: .travis.yml ================================================ language: node_js node_js: - "0.10" - "0.12" - 4 - 5 env: global: - secure: "JwyiLIEV6S7wzr9eUgQ/rP8BeeSY6ZabknHpUKSk4miA7d+/acFeuMAYu0d79BG8ndFIdG9EYbA7ZY1TH/metqDTrExzYLooa0XrAYg2x+cDSboII9albVn5bvdmmWIcgcmcZwKvi5JYLHWcA3Px84Aaf3YXN9V4lS1uLhl0eBI=" - secure: "BVYlZy3vIt21bhrzKPgQzRlbwGCBrdBtRPRvX/qCGi1jYAoAtrT0bYllZpNqduPLouW3LaJDwOJx9zLDmZDwKDvPgTinpVwmkhZYRFl1kNweku3ZfeHR5ejOVYvdQEqVU4rOtTBLk6emItEPTuFtC9SPSYQZQtjnZAjHTg0jqLU=" notifications: slack: reactivex:e424dAgQ2W9kuRMe6ngxHQbv webhooks: urls: - https://webhooks.gitter.im/e/8f1482d7420d95b647ce on_success: change # options: [always|never|change] default: always on_failure: always # options: [always|never|change] default: always on_start: false # default: false ================================================ FILE: Gruntfile.js ================================================ module.exports = function (grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), meta: { banner: '/*'+ 'Copyright (c) Microsoft. All rights reserved.\r\n' + 'Microsoft Open Technologies. Licensed under the Apache License, Version 2.0 (the "License"); you.\r\n' + 'may not use this file except in compliance with the License. You may.\r\n' + 'obtain a copy of the License at.\r\n\r\n' + 'http://www.apache.org/licenses/LICENSE-2.0.\r\n\r\n' + 'Unless required by applicable law or agreed to in writing, software.\r\n' + 'distributed under the License is distributed on an "AS IS" BASIS,.\r\n' + 'WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or.\r\n' + 'implied. See the License for the specific language governing permissions.\r\n' + 'and limitations under the License..\r\n' + '*/' }, concat: { core: { src: [ 'src/core/headers/license.js', 'src/core/headers/intro.js', 'src/core/headers/coreheader.js', // Stack trace start 'src/core/internal/trycatch.js', 'src/core/longstacktraces/longstackbegin.js', 'src/core/longstacktraces/longstacktraces.js', // internals 'src/core/internal/util.js', // Disposables 'src/core/disposables/compositedisposable.js', 'src/core/disposables/disposable.js', 'src/core/disposables/booleandisposable.js', 'src/core/disposables/binarydisposable.js', // Schedulers 'src/core/concurrency/scheduleditem.js', 'src/core/concurrency/scheduler.js', 'src/core/concurrency/scheduler.recursive.js', 'src/core/concurrency/scheduler.periodic.js', 'src/core/concurrency/scheduleperiodicrecursive.js', 'src/core/concurrency/immediatescheduler.js', 'src/core/concurrency/currentthreadscheduler.js', 'src/core/concurrency/defaultscheduler.js', 'src/core/internal/priorityqueue.js', // Observer 'src/core/observer-lite.js', 'src/core/abstractobserver.js', 'src/core/anonymousobserver.js', // Observable 'src/core/observable.js', 'src/core/anonymousobservable.js', 'src/core/perf/observablebase.js', 'src/core/autodetachobserver.js', 'src/core/linq/observable/create.js', 'src/core/headers/exports.js', // Long stacktrace end 'src/core/longstacktraces/longstackend.js', 'src/core/headers/outro.js' ], dest: 'dist/rx.core.js' }, 'core-binding': { src: [ 'src/core/headers/license.js', 'src/core/headers/core-intro.js', 'src/core/headers/core-bindingheader.js', 'src/core/internal/trycatch.js', 'src/core/linq/observable/multicast.js', 'src/core/linq/observable/publish.js', 'src/core/linq/observable/share.js', 'src/core/linq/observable/publishlast.js', 'src/core/linq/observable/publishvalue.js', 'src/core/linq/observable/sharevalue.js', 'src/core/linq/observable/replay.js', 'src/core/linq/observable/sharereplay.js', 'src/core/scheduledobserver.js', 'src/core/subjects/innersubscription.js', 'src/core/subjects/subject.js', 'src/core/subjects/anonymoussubject.js', 'src/core/subjects/asyncsubject.js', 'src/core/subjects/behaviorsubject.js', 'src/core/subjects/replaysubject.js', 'src/core/linq/connectableobservable.js', 'src/core/headers/suboutro.js' ], dest: 'dist/rx.core.binding.js' }, 'core-testing': { src: [ 'src/core/headers/license.js', 'src/core/headers/core-intro.js', 'src/core/headers/core-testheader.js', 'src/core/notification.js', 'src/core/internal/dontenums.js', 'src/core/internal/isequal.js', 'src/core/concurrency/scheduleperiodicrecursive.js', 'src/core/concurrency/virtualtimescheduler.js', 'src/core/testing/reactivetest.js', 'src/core/testing/recorded.js', 'src/core/testing/subscription.js', 'src/core/testing/mockdisposable.js', 'src/core/testing/mockobserver.js', 'src/core/testing/mockpromise.js', 'src/core/testing/hotobservable.js', 'src/core/testing/coldobservable.js', 'src/core/testing/testscheduler.js', 'src/core/headers/suboutro.js' ], dest: 'dist/rx.core.testing.js' }, all: { src: [ 'src/core/headers/license.js', 'src/core/headers/intro.js', 'src/core/headers/basicheader.js', // Stack trace start 'src/core/internal/trycatch.js', 'src/core/longstacktraces/longstackbegin.js', 'src/core/longstacktraces/longstacktraces.js', 'src/core/internal/errors.js', 'src/core/headers/enumeratorheader.js', 'src/core/internal/bindcallback.js', 'src/core/internal/dontenums.js', 'src/core/internal/isequal.js', 'src/core/internal/util.js', 'src/core/internal/priorityqueue.js', 'src/core/disposables/compositedisposable.js', 'src/core/disposables/disposable.js', 'src/core/disposables/booleandisposable.js', 'src/core/disposables/binarydisposable.js', 'src/core/disposables/refcountdisposable.js', 'src/core/disposables/scheduleddisposable.js', 'src/core/concurrency/scheduleditem.js', 'src/core/concurrency/scheduler.js', 'src/core/concurrency/scheduler.recursive.js', 'src/core/concurrency/scheduler.periodic.js', 'src/core/concurrency/scheduler.wrappers.js', 'src/core/concurrency/scheduleperiodicrecursive.js', 'src/core/concurrency/immediatescheduler.js', 'src/core/concurrency/currentthreadscheduler.js', 'src/core/concurrency/defaultscheduler.js', 'src/core/concurrency/catchscheduler.js', 'src/core/notification.js', 'src/core/observer.js', 'src/core/abstractobserver.js', 'src/core/anonymousobserver.js', 'src/core/checkedobserver.js', 'src/core/scheduledobserver.js', 'src/core/observeonobserver.js', 'src/core/observable.js', 'src/core/perf/observablebase.js', 'src/core/perf/operators/flatmapbase.js', 'src/core/enumerable.js', // Concurrency 'src/core/linq/observable/observeon.js', // ObserveOnObserver 'src/core/linq/observable/subscribeon.js', // SingleAssignmentDisposable, SerialDisposable, ScheduleDisposable // Async 'src/core/perf/operators/frompromise.js', // AsyncSubject, asObservable 'src/core/linq/observable/topromise.js', // Creation 'src/core/perf/operators/toarray.js', 'src/core/linq/observable/create.js', 'src/core/linq/observable/defer.js', 'src/core/perf/operators/empty.js', 'src/core/perf/operators/from.js', 'src/core/perf/operators/fromarrayobservable.js','src/core/perf/operators/fromarray.js', 'src/core/linq/observable/generate.js', 'src/core/perf/operators/of.js', 'src/core/linq/observable/ofarraychanges.js', 'src/core/linq/observable/ofobjectchanges.js', 'src/core/perf/operators/never.js', 'src/core/perf/operators/pairs.js', 'src/core/perf/operators/range.js', 'src/core/perf/operators/repeat.js', 'src/core/perf/operators/just.js', 'src/core/perf/operators/throw.js', 'src/core/linq/observable/using.js', // Multiple 'src/core/linq/observable/ambproto.js', 'src/core/linq/observable/amb.js', 'src/core/linq/observable/catchproto.js', 'src/core/linq/observable/catch.js', 'src/core/linq/observable/combinelatestproto.js', 'src/core/perf/operators/combinelatest.js', 'src/core/linq/observable/concatproto.js', 'src/core/perf/operators/concat.js', 'src/core/linq/observable/concatall.js', 'src/core/perf/operators/mergeconcat.js', 'src/core/linq/observable/merge.js', 'src/core/perf/operators/mergeall.js', 'src/core/linq/observable/mergedelayerror.js', 'src/core/linq/observable/onerrorresumenextproto.js', 'src/core/linq/observable/onerrorresumenext.js', 'src/core/perf/operators/skipuntil.js', 'src/core/perf/operators/switch.js', 'src/core/perf/operators/takeuntil.js', 'src/core/perf/operators/withlatestfrom.js', 'src/core/perf/operators/zip.js', 'src/core/linq/observable/zip.js', 'src/core/linq/observable/zipiterable.js', // Single 'src/core/linq/observable/asobservable.js', 'src/core/linq/observable/bufferwithcount.js', 'src/core/linq/observable/dematerialize.js', 'src/core/perf/operators/distinctuntilchanged.js', 'src/core/perf/operators/tap.js', 'src/core/perf/operators/finally.js', 'src/core/perf/operators/ignoreelements.js', 'src/core/linq/observable/materialize.js', 'src/core/linq/observable/repeatproto.js', 'src/core/linq/observable/retry.js', 'src/core/linq/observable/retrywhen.js', 'src/core/linq/observable/repeatwhen.js', 'src/core/perf/operators/scan.js', 'src/core/linq/observable/skiplast.js', 'src/core/linq/observable/startwith.js', 'src/core/linq/observable/takelast.js', 'src/core/linq/observable/takelastbuffer.js', 'src/core/linq/observable/windowwithcount.js', // Standard query operators 'src/core/linq/observable/concatmap.js', 'src/core/linq/observable/concatmapobserver.js', 'src/core/linq/observable/defaultifempty.js', 'src/core/linq/observable/distinct.js', 'src/core/linq/observable/groupby.js', 'src/core/linq/observable/groupbyuntil.js', 'src/core/perf/operators/map.js', 'src/core/linq/observable/pluck.js', 'src/core/perf/operators/flatmap.js', 'src/core/linq/observable/selectmanyobserver.js', 'src/core/perf/operators/flatmaplatest.js', 'src/core/perf/operators/skip.js', 'src/core/linq/observable/skipwhile.js', 'src/core/perf/operators/take.js', 'src/core/linq/observable/takewhile.js', 'src/core/perf/operators/filter.js', // Aggregate Operators 'src/core/linq/observable/_extremaby.js', 'src/core/linq/observable/_firstonly.js', 'src/core/perf/operators/reduce.js', // scan, startwith, finalvalue 'src/core/linq/observable/some.js', // where 'src/core/linq/observable/isempty.js', // any, select 'src/core/linq/observable/every.js', // where, any 'src/core/linq/observable/includes.js', // where, any 'src/core/linq/observable/count.js', // where, aggregate 'src/core/linq/observable/indexof.js', 'src/core/linq/observable/sum.js', // select, aggregate 'src/core/linq/observable/minby.js', // _extremaby 'src/core/linq/observable/min.js', // minby, _firstonly 'src/core/linq/observable/maxby.js', // _extremaby 'src/core/linq/observable/max.js', // max, _firstonly 'src/core/linq/observable/average.js', // select, scan, aggregate, finalvalue 'src/core/linq/observable/sequenceequal.js', // compositedisposable 'src/core/linq/observable/elementat.js', 'src/core/linq/observable/single.js', 'src/core/linq/observable/first.js', 'src/core/linq/observable/last.js', 'src/core/linq/observable/_findvalue.js', 'src/core/linq/observable/find.js', // _findvalue, where 'src/core/linq/observable/findindex.js', // _findvalue, where 'src/core/linq/observable/toset.js', 'src/core/linq/observable/tomap.js', 'src/core/linq/observable/slice.js', 'src/core/linq/observable/lastindexof.js', // Async operators 'src/core/linq/observable/spawn.js', 'src/core/linq/observable/start.js', // toasync 'src/core/linq/observable/toasync.js', // AsyncSubject, asObservable 'src/core/perf/operators/fromcallback.js', 'src/core/perf/operators/fromnodecallback.js', 'src/core/linq/observable/fromevent.js', // publish 'src/core/linq/observable/fromeventpattern.js', // publish 'src/core/linq/observable/startasync.js', // Backpressure operators 'src/core/backpressure/pausable.js', 'src/core/backpressure/pausablebuffered.js', 'src/core/backpressure/controlled.js', 'src/core/backpressure/stopandwait.js', 'src/core/backpressure/windowed.js', 'src/core/linq/observable/pipe.js', // Binding operators 'src/core/linq/observable/multicast.js', // ConnectableObservable 'src/core/linq/observable/publish.js', // mulitcast, Subject 'src/core/linq/observable/share.js', // mulitcast, Subject, Reference counted 'src/core/linq/observable/publishlast.js', // multicast, AsyncSubject 'src/core/linq/observable/publishvalue.js', // multicast, BehaviorSubject 'src/core/linq/observable/sharevalue.js', // multicast, BehaviorSubject, Reference counted 'src/core/linq/observable/replay.js', // multicast, ReplaySubject 'src/core/linq/observable/sharereplay.js', 'src/core/subjects/innersubscription.js', 'src/core/linq/connectableobservable.js', 'src/core/linq/observable/singleinstance.js', // Coincidence operators 'src/core/linq/observable/join.js', // SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, Dictionary 'src/core/linq/observable/groupjoin.js', // SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, Dictionary 'src/core/linq/observable/buffer.js', // window, selectMany, toArray 'src/core/linq/observable/window.js', // CompositeDisposable, RefCountDisposable, Subject, SingleAssignmentDisposable 'src/core/linq/observable/pairwise.js', 'src/core/linq/observable/partition.js', // Experimental operators 'src/core/linq/enumerable/while.js', // Enumerable 'src/core/linq/observable/let.js', 'src/core/linq/observable/if.js', // defer, empty 'src/core/linq/observable/for.js', // Enumerable.forEach, concatproto 'src/core/linq/observable/while.js', // Enumerable.while, concatproto 'src/core/linq/observable/dowhile.js', // Enumerable.while, concat 'src/core/linq/observable/case.js', // defer, empty 'src/core/linq/observable/expand.js', // immediateScheduler, SerialDisposable, CompositeDisposable, SingleAssignmentDisposable 'src/core/linq/observable/forkjoin.js', // CompositeDisposable 'src/core/linq/observable/forkjoinproto.js', // SingleAssignmentDisposable, CompositeDisposable 'src/core/linq/observable/manyselect.js', // ImmediateScheduler, CurrentThreadScheduler, select, do, observeOn // Join pattern operators 'src/core/internal/map.js', 'src/core/joins/pattern.js', 'src/core/joins/plan.js', 'src/core/joins/activeplan.js', 'src/core/joins/joinobserver.js', 'src/core/linq/observable/and.js', // Pattern 'src/core/linq/observable/thendo.js', // Pattern 'src/core/linq/observable/when.js', // CompositeDisposable // Time based operators 'src/core/linq/observable/_observabletimer.js', // AnonymousObservable 'src/core/linq/observable/_observabletimerdateandperiod.js', // AnonymousObservable, normalizeTime 'src/core/linq/observable/_observabletimertimespanandperiod.js', // AnonymousObservable, defer, _observabletimerdateandperiod 'src/core/linq/observable/interval.js', // timeoutScheduler, _observabletimertimespanandperiod 'src/core/linq/observable/timer.js', // timeoutScheduler, _observabletimerdate, _observabletimerdateandperiod, _observabletimertimespan, _observabletimertimespanandperiod 'src/core/linq/observable/delay.js', // AnonymousObservable, timeoutScheduler, SerialDisposable, materialize, timestamp 'src/core/linq/observable/debounce.js', // AnonymousObservable, SerialDisposable, timeoutScheduler, SingleAssignmentDisposable, CompositeDisposable 'src/core/linq/observable/windowwithtime.js', // AnonymousObservable, SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, addref, subject 'src/core/linq/observable/windowwithtimeorcount.js', // AnonymousObservable, SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, addref, subject 'src/core/linq/observable/bufferwithtime.js', // windowwithtime, selectMany, toArray 'src/core/linq/observable/bufferwithtimeorcount.js', // windowwithtimeorcount, selectMany, toArray 'src/core/linq/observable/timeinterval.js', // timeoutScheduler, defer, select 'src/core/linq/observable/timestamp.js', // timeoutScheduler, select 'src/core/linq/observable/sample.js', // AnonymousObservable, CompositeDisposable, interval, timeoutScheduler 'src/core/linq/observable/timeout.js', // AnonymousObservable, timeoutScheduler, throw, SingleAssignmentDisposable, SerialDisposable, CompositeDisposable 'src/core/linq/observable/generatewithabsolutetime.js', // timeoutScheduler, AnonymousObservable 'src/core/linq/observable/generatewithrelativetime.js', // timeoutScheduler, AnonymousObservable 'src/core/linq/observable/delaysubscription.js', // delayWithSelector, timer, empty 'src/core/linq/observable/skiplastwithtime.js', 'src/core/linq/observable/takelastwithtime.js', 'src/core/linq/observable/takelastbufferwithtime.js', 'src/core/linq/observable/takewithtime.js', 'src/core/linq/observable/skipwithtime.js', 'src/core/linq/observable/skipuntilwithtime.js', 'src/core/linq/observable/takeuntilwithtime.js', 'src/core/linq/observable/throttle.js', // Transducers 'src/core/linq/observable/transduce.js', // Experimental Flattening 'src/core/linq/observable/switchfirst.js', 'src/core/perf/operators/flatmapfirst.js', 'src/core/perf/operators/flatmapwithmaxconcurrent.js', // Virtual time 'src/core/concurrency/virtualtimescheduler.js', 'src/core/concurrency/historicalscheduler.js', 'src/core/testing/reactivetest.js', 'src/core/testing/recorded.js', 'src/core/testing/subscription.js', 'src/core/testing/mockdisposable.js', 'src/core/testing/mockobserver.js', 'src/core/testing/mockpromise.js', 'src/core/testing/hotobservable.js', 'src/core/testing/coldobservable.js', 'src/core/testing/testscheduler.js', 'src/core/anonymousobservable.js', 'src/core/autodetachobserver.js', 'src/core/linq/groupedobservable.js', 'src/core/subjects/innersubscription.js', 'src/core/subjects/subject.js', 'src/core/subjects/asyncsubject.js', 'src/core/subjects/behaviorsubject.js', 'src/core/subjects/replaysubject.js', 'src/core/subjects/anonymoussubject.js', 'src/core/backpressure/pauser.js', 'src/core/headers/exports.js', // Long stacktrace end 'src/core/longstacktraces/longstackend.js', 'src/core/headers/outro.js' ], dest: 'dist/rx.all.js' }, 'all-compat': { src: [ 'src/core/headers/license.js', 'src/core/headers/intro.js', 'src/core/headers/basicheader-compat.js', // Stack trace start 'src/core/internal/trycatch.js', 'src/core/longstacktraces/longstackbegin.js', 'src/core/longstacktraces/longstacktraces.js', 'src/core/internal/polyfills.js', 'src/core/internal/errors.js', 'src/core/headers/enumeratorheader.js', 'src/core/internal/bindcallback.js', 'src/core/internal/dontenums.js', 'src/core/internal/isequal.js', 'src/core/internal/util.js', 'src/core/internal/priorityqueue.js', 'src/core/disposables/compositedisposable.js', 'src/core/disposables/disposable.js', 'src/core/disposables/booleandisposable.js', 'src/core/disposables/binarydisposable.js', 'src/core/disposables/refcountdisposable.js', 'src/core/disposables/scheduleddisposable.js', 'src/core/concurrency/scheduleditem.js', 'src/core/concurrency/scheduler.js', 'src/core/concurrency/scheduler.recursive.js', 'src/core/concurrency/scheduler.periodic.js', 'src/core/concurrency/scheduler.wrappers.js', 'src/core/concurrency/scheduleperiodicrecursive.js', 'src/core/concurrency/immediatescheduler.js', 'src/core/concurrency/currentthreadscheduler.js', 'src/core/concurrency/defaultscheduler.js', 'src/core/concurrency/catchscheduler.js', 'src/core/notification.js', 'src/core/observer.js', 'src/core/abstractobserver.js', 'src/core/anonymousobserver.js', 'src/core/checkedobserver.js', 'src/core/scheduledobserver.js', 'src/core/observeonobserver.js', 'src/core/observable.js', 'src/core/perf/observablebase.js', 'src/core/perf/operators/flatmapbase.js', 'src/core/enumerable.js', 'src/core/linq/observable/observeon.js', // ObserveOnObserver 'src/core/linq/observable/subscribeon.js', // SingleAssignmentDisposable, SerialDisposable, ScheduleDisposable // Async 'src/core/perf/operators/frompromise.js', // AsyncSubject, asObservable 'src/core/linq/observable/topromise.js', // Creation 'src/core/perf/operators/toarray.js', 'src/core/linq/observable/create.js', 'src/core/linq/observable/defer.js', 'src/core/perf/operators/empty.js', 'src/core/perf/operators/from.js', 'src/core/perf/operators/fromarrayobservable.js','src/core/perf/operators/fromarray.js', 'src/core/linq/observable/generate.js', 'src/core/perf/operators/of.js', 'src/core/perf/operators/never.js', 'src/core/perf/operators/pairs.js', 'src/core/perf/operators/range.js', 'src/core/perf/operators/repeat.js', 'src/core/perf/operators/just.js', 'src/core/perf/operators/throw.js', 'src/core/linq/observable/using.js', // Multiple 'src/core/linq/observable/ambproto.js', 'src/core/linq/observable/amb.js', 'src/core/linq/observable/catchproto.js', 'src/core/linq/observable/catch.js', 'src/core/linq/observable/combinelatestproto.js', 'src/core/perf/operators/combinelatest.js', 'src/core/linq/observable/concatproto.js', 'src/core/perf/operators/concat.js', 'src/core/linq/observable/concatall.js', 'src/core/perf/operators/mergeconcat.js', 'src/core/linq/observable/merge.js', 'src/core/perf/operators/mergeall.js', 'src/core/linq/observable/mergedelayerror.js', 'src/core/linq/observable/onerrorresumenextproto.js', 'src/core/linq/observable/onerrorresumenext.js', 'src/core/perf/operators/skipuntil.js', 'src/core/perf/operators/switch.js', 'src/core/perf/operators/takeuntil.js', 'src/core/perf/operators/withlatestfrom.js', 'src/core/perf/operators/zip.js', 'src/core/linq/observable/zip.js', 'src/core/linq/observable/zipiterable.js', // Single 'src/core/linq/observable/asobservable.js', 'src/core/linq/observable/bufferwithcount.js', 'src/core/linq/observable/dematerialize.js', 'src/core/perf/operators/distinctuntilchanged.js', 'src/core/perf/operators/tap.js', 'src/core/perf/operators/finally.js', 'src/core/perf/operators/ignoreelements.js', 'src/core/linq/observable/materialize.js', 'src/core/linq/observable/repeatproto.js', 'src/core/linq/observable/retry.js', 'src/core/linq/observable/retrywhen.js', 'src/core/linq/observable/repeatwhen.js', 'src/core/perf/operators/scan.js', 'src/core/linq/observable/skiplast.js', 'src/core/linq/observable/startwith.js', 'src/core/linq/observable/takelast.js', 'src/core/linq/observable/takelastbuffer.js', 'src/core/linq/observable/windowwithcount.js', // Standard query operators 'src/core/perf/operators/concatmap.js', 'src/core/linq/observable/concatmapobserver.js', 'src/core/linq/observable/defaultifempty.js', 'src/core/linq/observable/distinct.js', 'src/core/linq/observable/groupby.js', 'src/core/linq/observable/groupbyuntil.js', 'src/core/perf/operators/map.js', 'src/core/linq/observable/pluck.js', 'src/core/perf/operators/flatmap.js', 'src/core/linq/observable/selectmanyobserver.js', 'src/core/perf/operators/flatmaplatest.js', 'src/core/perf/operators/skip.js', 'src/core/linq/observable/skipwhile.js', 'src/core/perf/operators/take.js', 'src/core/linq/observable/takewhile.js', 'src/core/perf/operators/filter.js', // Aggregate operators 'src/core/linq/observable/_extremaby.js', 'src/core/linq/observable/_firstonly.js', 'src/core/perf/operators/reduce.js', // scan, startwith, finalvalue 'src/core/linq/observable/some.js', // where 'src/core/linq/observable/isempty.js', // any, select 'src/core/linq/observable/every.js', // where, any 'src/core/linq/observable/includes.js', // where, any 'src/core/linq/observable/count.js', // where, aggregate 'src/core/linq/observable/indexof.js', 'src/core/linq/observable/sum.js', // select, aggregate 'src/core/linq/observable/minby.js', // _extremaby 'src/core/linq/observable/min.js', // minby, _firstonly 'src/core/linq/observable/maxby.js', // _extremaby 'src/core/linq/observable/max.js', // max, _firstonly 'src/core/linq/observable/average.js', // select, scan, aggregate, finalvalue 'src/core/linq/observable/sequenceequal.js', // compositedisposable 'src/core/linq/observable/elementat.js', 'src/core/linq/observable/single.js', 'src/core/linq/observable/first.js', 'src/core/linq/observable/last.js', 'src/core/linq/observable/_findvalue.js', 'src/core/linq/observable/find.js', // _findvalue, where 'src/core/linq/observable/findindex.js', // _findvalue, where 'src/core/linq/observable/toset.js', 'src/core/linq/observable/tomap.js', 'src/core/linq/observable/slice.js', 'src/core/linq/observable/lastindexof.js', // Async compat operators 'src/core/linq/observable/spawn.js', 'src/core/linq/observable/start.js', // toasync 'src/core/linq/observable/toasync.js', // asyncsubject, asObservable 'src/core/perf/operators/fromcallback.js', 'src/core/perf/operators/fromnodecallback.js', 'src/core/linq/observable/fromevent.js', // publish 'src/core/linq/observable/fromeventpattern.js', // publish 'src/core/linq/observable/startasync.js', // Backpressure operators 'src/core/backpressure/pausable.js', 'src/core/backpressure/pausablebuffered.js', 'src/core/backpressure/controlled.js', 'src/core/backpressure/stopandwait.js', 'src/core/backpressure/windowed.js', 'src/core/linq/observable/pipe.js', // Binding operators 'src/core/linq/observable/multicast.js', // ConnectableObservable 'src/core/linq/observable/publish.js', // mulitcast, Subject 'src/core/linq/observable/share.js', // mulitcast, Subject, Reference counted 'src/core/linq/observable/publishlast.js', // multicast, AsyncSubject 'src/core/linq/observable/publishvalue.js', // multicast, BehaviorSubject 'src/core/linq/observable/sharevalue.js', // multicast, BehaviorSubject, Reference counted 'src/core/linq/observable/replay.js', // multicast, ReplaySubject 'src/core/linq/observable/sharereplay.js', 'src/core/subjects/innersubscription.js', 'src/core/linq/connectableobservable.js', 'src/core/linq/observable/singleinstance.js', // Coincidence operators 'src/core/linq/observable/join.js', // SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, Dictionary 'src/core/linq/observable/groupjoin.js', // SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, Dictionary 'src/core/linq/observable/buffer.js', // window, selectMany, toArray 'src/core/linq/observable/window.js', // CompositeDisposable, RefCountDisposable, Subject, SingleAssignmentDisposable 'src/core/linq/observable/pairwise.js', 'src/core/linq/observable/partition.js', // Experimental operators 'src/core/linq/enumerable/while.js', // Enumerable 'src/core/linq/observable/let.js', 'src/core/linq/observable/if.js', // defer, empty 'src/core/linq/observable/for.js', // Enumerable.forEach, concatproto 'src/core/linq/observable/while.js', // Enumerable.while, concatproto 'src/core/linq/observable/dowhile.js', // Enumerable.while, concat 'src/core/linq/observable/case.js', // defer, empty 'src/core/linq/observable/expand.js', // immediateScheduler, SerialDisposable, CompositeDisposable, SingleAssignmentDisposable 'src/core/linq/observable/forkjoin.js', // CompositeDisposable 'src/core/linq/observable/forkjoinproto.js', // SingleAssignmentDisposable, CompositeDisposable 'src/core/linq/observable/manyselect.js', // ImmediateScheduler, CurrentThreadScheduler, select, do, observeOn // Join pattern operators 'src/core/internal/map.js', 'src/core/joins/pattern.js', 'src/core/joins/plan.js', 'src/core/joins/activeplan.js', 'src/core/joins/joinobserver.js', 'src/core/linq/observable/and.js', // Pattern 'src/core/linq/observable/thendo.js', // Pattern 'src/core/linq/observable/when.js', // CompositeDisposable // Time based operators 'src/core/linq/observable/_observabletimer.js', // AnonymousObservable 'src/core/linq/observable/_observabletimerdateandperiod.js', // AnonymousObservable, normalizeTime 'src/core/linq/observable/_observabletimertimespanandperiod.js', // AnonymousObservable, defer, _observabletimerdateandperiod 'src/core/linq/observable/interval.js', // timeoutScheduler, _observabletimertimespanandperiod 'src/core/linq/observable/timer.js', // timeoutScheduler, _observabletimerdate, _observabletimerdateandperiod, _observabletimertimespan, _observabletimertimespanandperiod 'src/core/linq/observable/delay.js', // AnonymousObservable, timeoutScheduler, SerialDisposable, materialize, timestamp 'src/core/linq/observable/debounce.js', // AnonymousObservable, SerialDisposable, timeoutScheduler, SingleAssignmentDisposable, CompositeDisposable 'src/core/linq/observable/windowwithtime.js', // AnonymousObservable, SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, addref, subject 'src/core/linq/observable/windowwithtimeorcount.js', // AnonymousObservable, SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, addref, subject 'src/core/linq/observable/bufferwithtime.js', // windowwithtime, selectMany, toArray 'src/core/linq/observable/bufferwithtimeorcount.js', // windowwithtimeorcount, selectMany, toArray 'src/core/linq/observable/timeinterval.js', // timeoutScheduler, defer, select 'src/core/linq/observable/timestamp.js', // timeoutScheduler, select 'src/core/linq/observable/sample.js', // AnonymousObservable, CompositeDisposable, interval, timeoutScheduler 'src/core/linq/observable/timeout.js', // AnonymousObservable, timeoutScheduler, throw, SingleAssignmentDisposable, SerialDisposable, CompositeDisposable 'src/core/linq/observable/generatewithabsolutetime.js', // timeoutScheduler, AnonymousObservable 'src/core/linq/observable/generatewithrelativetime.js', // timeoutScheduler, AnonymousObservable 'src/core/linq/observable/delaysubscription.js', // delayWithSelector, timer, empty 'src/core/linq/observable/skiplastwithtime.js', 'src/core/linq/observable/takelastwithtime.js', 'src/core/linq/observable/takelastbufferwithtime.js', 'src/core/linq/observable/takewithtime.js', 'src/core/linq/observable/skipwithtime.js', 'src/core/linq/observable/skipuntilwithtime.js', 'src/core/linq/observable/takeuntilwithtime.js', 'src/core/linq/observable/throttle.js', // Experimental Flattening 'src/core/linq/observable/switchfirst.js', 'src/core/perf/operators/flatmapfirst.js', 'src/core/perf/operators/flatmapwithmaxconcurrent.js', // Transducers 'src/core/linq/observable/transduce.js', // Virtual time 'src/core/concurrency/virtualtimescheduler.js', 'src/core/concurrency/historicalscheduler.js', 'src/core/testing/reactivetest.js', 'src/core/testing/recorded.js', 'src/core/testing/subscription.js', 'src/core/testing/mockdisposable.js', 'src/core/testing/mockobserver.js', 'src/core/testing/mockpromise.js', 'src/core/testing/hotobservable.js', 'src/core/testing/coldobservable.js', 'src/core/testing/testscheduler.js', 'src/core/anonymousobservable.js', 'src/core/autodetachobserver.js', 'src/core/linq/groupedobservable.js', 'src/core/subjects/innersubscription.js', 'src/core/subjects/subject.js', 'src/core/subjects/asyncsubject.js', 'src/core/subjects/anonymoussubject.js', 'src/core/subjects/behaviorsubject.js', 'src/core/subjects/replaysubject.js', 'src/core/backpressure/pauser.js', 'src/core/headers/exports.js', // End long stack traces 'src/core/longstacktraces/longstackend.js', 'src/core/headers/outro.js', ], dest: 'dist/rx.all.compat.js' }, main: { src: [ 'src/core/headers/license.js', 'src/core/headers/intro.js', 'src/core/headers/basicheader.js', // Stack trace start 'src/core/internal/trycatch.js', 'src/core/longstacktraces/longstackbegin.js', 'src/core/longstacktraces/longstacktraces.js', 'src/core/internal/errors.js', 'src/core/headers/enumeratorheader.js', 'src/core/internal/bindcallback.js', 'src/core/internal/dontenums.js', 'src/core/internal/isequal.js', 'src/core/internal/util.js', 'src/core/disposables/compositedisposable.js', 'src/core/disposables/disposable.js', 'src/core/disposables/booleandisposable.js', 'src/core/disposables/binarydisposable.js', 'src/core/disposables/refcountdisposable.js', 'src/core/disposables/scheduleddisposable.js', 'src/core/concurrency/scheduleditem.js', 'src/core/concurrency/scheduler.js', 'src/core/concurrency/scheduler.recursive.js', 'src/core/concurrency/scheduler.periodic.js', 'src/core/concurrency/scheduler.wrappers.js', 'src/core/concurrency/scheduleperiodicrecursive.js', 'src/core/concurrency/immediatescheduler.js', 'src/core/concurrency/currentthreadscheduler.js', 'src/core/concurrency/defaultscheduler.js', 'src/core/concurrency/catchscheduler.js', 'src/core/internal/priorityqueue.js', 'src/core/notification.js', 'src/core/observer.js', 'src/core/abstractobserver.js', 'src/core/anonymousobserver.js', 'src/core/checkedobserver.js', 'src/core/scheduledobserver.js', 'src/core/observeonobserver.js', 'src/core/observable.js', 'src/core/perf/observablebase.js', 'src/core/perf/operators/flatmapbase.js', 'src/core/enumerable.js', // Concurrency 'src/core/linq/observable/observeon.js', // ObserveOnObserver 'src/core/linq/observable/subscribeon.js', // SingleAssignmentDisposable, SerialDisposable, ScheduleDisposable // Async 'src/core/perf/operators/frompromise.js', // AsyncSubject, asObservable 'src/core/linq/observable/topromise.js', // Creation 'src/core/perf/operators/toarray.js', 'src/core/linq/observable/create.js', 'src/core/linq/observable/defer.js', 'src/core/perf/operators/empty.js', 'src/core/perf/operators/from.js', 'src/core/perf/operators/fromarrayobservable.js','src/core/perf/operators/fromarray.js', 'src/core/linq/observable/generate.js', 'src/core/perf/operators/never.js', 'src/core/perf/operators/of.js', 'src/core/perf/operators/pairs.js', 'src/core/perf/operators/range.js', 'src/core/perf/operators/repeat.js', 'src/core/perf/operators/just.js', 'src/core/perf/operators/throw.js', 'src/core/linq/observable/using.js', // Multiple 'src/core/linq/observable/ambproto.js', 'src/core/linq/observable/amb.js', 'src/core/linq/observable/catchproto.js', 'src/core/linq/observable/catch.js', 'src/core/linq/observable/combinelatestproto.js', 'src/core/perf/operators/combinelatest.js', 'src/core/linq/observable/concatproto.js', 'src/core/perf/operators/concat.js', 'src/core/linq/observable/concatall.js', 'src/core/perf/operators/mergeconcat.js', 'src/core/linq/observable/merge.js', 'src/core/linq/observable/mergedelayerror.js', 'src/core/perf/operators/mergeall.js', 'src/core/linq/observable/onerrorresumenextproto.js', 'src/core/linq/observable/onerrorresumenext.js', 'src/core/perf/operators/skipuntil.js', 'src/core/perf/operators/switch.js', 'src/core/perf/operators/takeuntil.js', 'src/core/perf/operators/withlatestfrom.js', 'src/core/perf/operators/zip.js', 'src/core/linq/observable/zip.js', 'src/core/linq/observable/zipiterable.js', // Single 'src/core/linq/observable/asobservable.js', 'src/core/linq/observable/bufferwithcount.js', 'src/core/linq/observable/dematerialize.js', 'src/core/perf/operators/distinctuntilchanged.js', 'src/core/perf/operators/tap.js', 'src/core/perf/operators/finally.js', 'src/core/perf/operators/ignoreelements.js', 'src/core/linq/observable/materialize.js', 'src/core/linq/observable/repeatproto.js', 'src/core/linq/observable/retry.js', 'src/core/linq/observable/retrywhen.js', 'src/core/linq/observable/repeatwhen.js', 'src/core/perf/operators/scan.js', 'src/core/linq/observable/skiplast.js', 'src/core/linq/observable/startwith.js', 'src/core/linq/observable/takelast.js', 'src/core/linq/observable/takelastbuffer.js', 'src/core/linq/observable/windowwithcount.js', // Standard query operators 'src/core/perf/operators/concatmap.js', 'src/core/linq/observable/concatmapobserver.js', 'src/core/linq/observable/defaultifempty.js', 'src/core/linq/observable/distinct.js', 'src/core/perf/operators/map.js', 'src/core/linq/observable/pluck.js', 'src/core/linq/observable/selectmanyobserver.js', 'src/core/perf/operators/flatmap.js', 'src/core/perf/operators/flatmaplatest.js', 'src/core/perf/operators/skip.js', 'src/core/linq/observable/skipwhile.js', 'src/core/perf/operators/take.js', 'src/core/linq/observable/takewhile.js', 'src/core/perf/operators/filter.js', // Transducers 'src/core/linq/observable/transduce.js', 'src/core/anonymousobservable.js', 'src/core/autodetachobserver.js', 'src/core/subjects/innersubscription.js', 'src/core/subjects/subject.js', 'src/core/subjects/asyncsubject.js', 'src/core/subjects/anonymoussubject.js', 'src/core/headers/exports.js', // Long stack trace end 'src/core/longstacktraces/longstackend.js', 'src/core/headers/outro.js', ], dest: 'dist/rx.js' }, 'main-compat': { src: [ 'src/core/headers/license.js', 'src/core/headers/intro.js', 'src/core/headers/basicheader-compat.js', // Stack trace start 'src/core/internal/trycatch.js', 'src/core/longstacktraces/longstackbegin.js', 'src/core/longstacktraces/longstacktraces.js', 'src/core/internal/polyfills.js', 'src/core/internal/errors.js', 'src/core/headers/enumeratorheader.js', 'src/core/internal/bindcallback.js', 'src/core/internal/dontenums.js', 'src/core/internal/isequal.js', 'src/core/internal/util.js', 'src/core/disposables/compositedisposable.js', 'src/core/disposables/disposable.js', 'src/core/disposables/booleandisposable.js', 'src/core/disposables/binarydisposable.js', 'src/core/disposables/refcountdisposable.js', 'src/core/disposables/scheduleddisposable.js', 'src/core/concurrency/scheduleditem.js', 'src/core/concurrency/scheduler.js', 'src/core/concurrency/scheduler.recursive.js', 'src/core/concurrency/scheduler.periodic.js', 'src/core/concurrency/scheduler.wrappers.js', 'src/core/concurrency/scheduleperiodicrecursive.js', 'src/core/concurrency/immediatescheduler.js', 'src/core/concurrency/currentthreadscheduler.js', 'src/core/concurrency/defaultscheduler.js', 'src/core/concurrency/catchscheduler.js', 'src/core/internal/priorityqueue.js', 'src/core/notification.js', 'src/core/observer.js', 'src/core/abstractobserver.js', 'src/core/anonymousobserver.js', 'src/core/checkedobserver.js', 'src/core/scheduledobserver.js', 'src/core/observeonobserver.js', 'src/core/observable.js', 'src/core/perf/observablebase.js', 'src/core/perf/operators/flatmapbase.js', 'src/core/enumerable.js', 'src/core/linq/observable/observeon.js', // ObserveOnObserver 'src/core/linq/observable/subscribeon.js', // SingleAssignmentDisposable, SerialDisposable, ScheduleDisposable // Async 'src/core/perf/operators/frompromise.js', // AsyncSubject, asObservable 'src/core/linq/observable/topromise.js', // Creation 'src/core/perf/operators/toarray.js', 'src/core/linq/observable/create.js', 'src/core/linq/observable/defer.js', 'src/core/perf/operators/empty.js', 'src/core/perf/operators/from.js', 'src/core/perf/operators/fromarrayobservable.js','src/core/perf/operators/fromarray.js', 'src/core/linq/observable/generate.js', 'src/core/perf/operators/never.js', 'src/core/perf/operators/of.js', 'src/core/perf/operators/pairs.js', 'src/core/perf/operators/range.js', 'src/core/perf/operators/repeat.js', 'src/core/perf/operators/just.js', 'src/core/perf/operators/throw.js', 'src/core/linq/observable/using.js', // Multiple 'src/core/linq/observable/ambproto.js', 'src/core/linq/observable/amb.js', 'src/core/linq/observable/catchproto.js', 'src/core/linq/observable/catch.js', 'src/core/linq/observable/combinelatestproto.js', 'src/core/perf/operators/combinelatest.js', 'src/core/linq/observable/concatproto.js', 'src/core/perf/operators/concat.js', 'src/core/linq/observable/concatall.js', 'src/core/perf/operators/mergeconcat.js', 'src/core/linq/observable/merge.js', 'src/core/perf/operators/mergeall.js', 'src/core/linq/observable/mergedelayerror.js', 'src/core/linq/observable/onerrorresumenextproto.js', 'src/core/linq/observable/onerrorresumenext.js', 'src/core/perf/operators/skipuntil.js', 'src/core/perf/operators/switch.js', 'src/core/perf/operators/takeuntil.js', 'src/core/perf/operators/withlatestfrom.js', 'src/core/perf/operators/zip.js', 'src/core/linq/observable/zip.js', 'src/core/linq/observable/zipiterable.js', // Single 'src/core/linq/observable/asobservable.js', 'src/core/linq/observable/bufferwithcount.js', 'src/core/linq/observable/dematerialize.js', 'src/core/perf/operators/distinctuntilchanged.js', 'src/core/perf/operators/tap.js', 'src/core/perf/operators/finally.js', 'src/core/perf/operators/ignoreelements.js', 'src/core/linq/observable/materialize.js', 'src/core/linq/observable/repeatproto.js', 'src/core/linq/observable/retry.js', 'src/core/linq/observable/retrywhen.js', 'src/core/linq/observable/repeatwhen.js', 'src/core/perf/operators/scan.js', 'src/core/linq/observable/skiplast.js', 'src/core/linq/observable/startwith.js', 'src/core/linq/observable/takelast.js', 'src/core/linq/observable/takelastbuffer.js', 'src/core/linq/observable/windowwithcount.js', // Standard query operators 'src/core/perf/operators/concatmap.js', 'src/core/linq/observable/concatmapobserver.js', 'src/core/linq/observable/defaultifempty.js', 'src/core/linq/observable/distinct.js', 'src/core/perf/operators/map.js', 'src/core/linq/observable/pluck.js', 'src/core/perf/operators/flatmap.js', 'src/core/linq/observable/selectmanyobserver.js', 'src/core/perf/operators/flatmaplatest.js', 'src/core/perf/operators/skip.js', 'src/core/linq/observable/skipwhile.js', 'src/core/perf/operators/take.js', 'src/core/linq/observable/takewhile.js', 'src/core/perf/operators/filter.js', // Transducers 'src/core/linq/observable/transduce.js', 'src/core/anonymousobservable.js', 'src/core/autodetachobserver.js', 'src/core/subjects/innersubscription.js', 'src/core/subjects/subject.js', 'src/core/subjects/asyncsubject.js', 'src/core/subjects/anonymoussubject.js', 'src/core/headers/exports.js', 'src/core/longstacktraces/longstackend.js', 'src/core/headers/outro.js', ], dest: 'dist/rx.compat.js' }, lite: { src: [ 'src/core/headers/license.js', 'src/core/headers/intro.js', 'src/core/headers/liteheader.js', // Stack trace start 'src/core/internal/trycatch.js', 'src/core/longstacktraces/longstackbegin.js', 'src/core/longstacktraces/longstacktraces.js', 'src/core/internal/errors.js', 'src/core/headers/enumeratorheader.js', 'src/core/internal/bindcallback.js', 'src/core/internal/dontenums.js', 'src/core/internal/isequal.js', 'src/core/internal/util.js', 'src/core/disposables/compositedisposable.js', 'src/core/disposables/disposable.js', 'src/core/disposables/booleandisposable.js', 'src/core/disposables/binarydisposable.js', 'src/core/disposables/refcountdisposable.js', 'src/core/concurrency/scheduleditem.js', 'src/core/concurrency/scheduler.js', 'src/core/concurrency/scheduler.recursive.js', 'src/core/concurrency/scheduler.periodic.js', 'src/core/concurrency/immediatescheduler.js', 'src/core/concurrency/currentthreadscheduler.js', 'src/core/concurrency/scheduleperiodicrecursive.js', 'src/core/concurrency/defaultscheduler.js', 'src/core/internal/priorityqueue.js', 'src/core/notification.js', 'src/core/observer-lite.js', 'src/core/abstractobserver.js', 'src/core/anonymousobserver.js', 'src/core/observable.js', 'src/core/scheduledobserver.js', 'src/core/perf/observablebase.js', 'src/core/perf/operators/flatmapbase.js', 'src/core/enumerable.js', // Creation 'src/core/perf/operators/toarray.js', 'src/core/linq/observable/create.js', 'src/core/linq/observable/defer.js', 'src/core/perf/operators/empty.js', 'src/core/perf/operators/from.js', 'src/core/perf/operators/fromarrayobservable.js','src/core/perf/operators/fromarray.js', 'src/core/perf/operators/never.js', 'src/core/perf/operators/of.js', 'src/core/perf/operators/pairs.js', 'src/core/perf/operators/range.js', 'src/core/perf/operators/repeat.js', 'src/core/perf/operators/just.js', 'src/core/perf/operators/throw.js', // Multiple 'src/core/linq/observable/catchproto.js', 'src/core/linq/observable/catch.js', 'src/core/linq/observable/combinelatestproto.js', 'src/core/perf/operators/combinelatest.js', 'src/core/linq/observable/concatproto.js', 'src/core/perf/operators/concat.js', 'src/core/linq/observable/concatall.js', 'src/core/perf/operators/mergeconcat.js', 'src/core/linq/observable/merge.js', 'src/core/linq/observable/mergedelayerror.js', 'src/core/perf/operators/mergeall.js', 'src/core/perf/operators/skipuntil.js', 'src/core/perf/operators/switch.js', 'src/core/perf/operators/takeuntil.js', 'src/core/perf/operators/withlatestfrom.js', 'src/core/perf/operators/zip.js', 'src/core/linq/observable/zip.js', 'src/core/linq/observable/zipiterable.js', // Single 'src/core/linq/observable/asobservable.js', 'src/core/linq/observable/dematerialize.js', 'src/core/perf/operators/distinctuntilchanged.js', 'src/core/perf/operators/tap.js', 'src/core/perf/operators/finally.js', 'src/core/perf/operators/ignoreelements.js', 'src/core/linq/observable/materialize.js', 'src/core/linq/observable/repeatproto.js', 'src/core/linq/observable/retry.js', 'src/core/linq/observable/retrywhen.js', 'src/core/linq/observable/repeatwhen.js', 'src/core/perf/operators/scan.js', 'src/core/linq/observable/skiplast.js', 'src/core/linq/observable/startwith.js', 'src/core/linq/observable/takelast.js', // Standard Query Operators 'src/core/perf/operators/concatmap.js', 'src/core/perf/operators/map.js', 'src/core/linq/observable/pluck.js', 'src/core/perf/operators/flatmap.js', 'src/core/perf/operators/flatmaplatest.js', 'src/core/perf/operators/skip.js', 'src/core/linq/observable/skipwhile.js', 'src/core/perf/operators/take.js', 'src/core/linq/observable/takewhile.js', 'src/core/perf/operators/filter.js', // Async Operators 'src/core/perf/operators/fromcallback.js', 'src/core/perf/operators/fromnodecallback.js', 'src/core/linq/observable/fromevent.js', // publish 'src/core/linq/observable/fromeventpattern.js', // publish 'src/core/perf/operators/frompromise.js', // AsyncSubject, asObservable 'src/core/linq/observable/topromise.js', 'src/core/linq/observable/startasync.js', // Binding Operators 'src/core/linq/observable/multicast.js', // ConnectableObservable 'src/core/linq/observable/publish.js', // mulitcast, Subject 'src/core/linq/observable/share.js', // mulitcast, Subject, Reference counted 'src/core/linq/observable/publishlast.js', // multicast, AsyncSubject 'src/core/linq/observable/publishvalue.js', // multicast, BehaviorSubject 'src/core/linq/observable/sharevalue.js', // multicast, BehaviorSubject, Reference counted 'src/core/linq/observable/replay.js', // multicast, ReplaySubject 'src/core/linq/observable/sharereplay.js', 'src/core/linq/connectableobservable.js', // Time operators 'src/core/linq/observable/_observabletimer.js', // AnonymousObservable 'src/core/linq/observable/_observabletimerdateandperiod.js', // AnonymousObservable, normalizeTime 'src/core/linq/observable/_observabletimertimespanandperiod.js', // AnonymousObservable, defer, _observabletimerdateandperiod 'src/core/linq/observable/interval.js', // timeoutScheduler, _observabletimertimespanandperiod 'src/core/linq/observable/timer.js', // timeoutScheduler, _observabletimerdate, _observabletimerdateandperiod, _observabletimertimespan, _observabletimertimespanandperiod 'src/core/linq/observable/delay.js', // AnonymousObservable, timeoutScheduler, SerialDisposable, materialize, timestamp 'src/core/linq/observable/debounce.js', // AnonymousObservable, SerialDisposable, timeoutScheduler, SingleAssignmentDisposable, CompositeDisposable 'src/core/linq/observable/timestamp.js', // timeoutScheduler, select 'src/core/linq/observable/sample.js', // AnonymousObservable, CompositeDisposable, interval, timeoutScheduler 'src/core/linq/observable/timeout.js', // AnonymousObservable, timeoutScheduler, throw, SingleAssignmentDisposable, SerialDisposable, CompositeDisposable 'src/core/linq/observable/throttle.js', // Backpressure operators 'src/core/backpressure/pausable.js', 'src/core/backpressure/pausablebuffered.js', 'src/core/backpressure/controlled.js', 'src/core/linq/observable/pipe.js', // Transducers 'src/core/linq/observable/transduce.js', 'src/core/anonymousobservable.js', 'src/core/autodetachobserver.js', 'src/core/subjects/innersubscription.js', 'src/core/subjects/subject.js', 'src/core/subjects/asyncsubject.js', 'src/core/subjects/anonymoussubject.js', 'src/core/subjects/behaviorsubject.js', 'src/core/subjects/replaysubject.js', 'src/core/backpressure/pauser.js', 'src/core/headers/exports.js', // End long stack traces 'src/core/longstacktraces/longstackend.js', 'src/core/headers/outro.js', ], dest: 'dist/rx.lite.js' }, 'lite-compat': { src: [ 'src/core/headers/license.js', 'src/core/headers/intro.js', 'src/core/headers/liteheader-compat.js', // Stack trace start 'src/core/internal/trycatch.js', 'src/core/longstacktraces/longstackbegin.js', 'src/core/longstacktraces/longstacktraces.js', 'src/core/internal/polyfills.js', 'src/core/internal/errors.js', 'src/core/headers/enumeratorheader.js', 'src/core/internal/bindcallback.js', 'src/core/internal/dontenums.js', 'src/core/internal/isequal.js', 'src/core/internal/util.js', 'src/core/disposables/compositedisposable.js', 'src/core/disposables/disposable.js', 'src/core/disposables/booleandisposable.js', 'src/core/disposables/binarydisposable.js', 'src/core/disposables/refcountdisposable.js', 'src/core/concurrency/scheduleditem.js', 'src/core/concurrency/scheduler.js', 'src/core/concurrency/scheduler.recursive.js', 'src/core/concurrency/scheduler.periodic.js', 'src/core/concurrency/immediatescheduler.js', 'src/core/concurrency/currentthreadscheduler.js', 'src/core/concurrency/scheduleperiodicrecursive.js', 'src/core/concurrency/defaultscheduler.js', 'src/core/internal/priorityqueue.js', 'src/core/notification.js', 'src/core/observer-lite.js', 'src/core/abstractobserver.js', 'src/core/anonymousobserver.js', 'src/core/observable.js', 'src/core/perf/observablebase.js', 'src/core/perf/operators/flatmapbase.js', 'src/core/enumerable.js', 'src/core/scheduledobserver.js', // Creation 'src/core/perf/operators/toarray.js', 'src/core/linq/observable/create.js', 'src/core/linq/observable/defer.js', 'src/core/perf/operators/empty.js', 'src/core/perf/operators/from.js', 'src/core/perf/operators/fromarrayobservable.js','src/core/perf/operators/fromarray.js', 'src/core/perf/operators/never.js', 'src/core/perf/operators/of.js', 'src/core/perf/operators/pairs.js', 'src/core/perf/operators/range.js', 'src/core/perf/operators/repeat.js', 'src/core/perf/operators/just.js', 'src/core/perf/operators/throw.js', // Multiple 'src/core/linq/observable/catchproto.js', 'src/core/linq/observable/catch.js', 'src/core/linq/observable/combinelatestproto.js', 'src/core/perf/operators/combinelatest.js', 'src/core/linq/observable/concatproto.js', 'src/core/perf/operators/concat.js', 'src/core/linq/observable/concatall.js', 'src/core/perf/operators/mergeconcat.js', 'src/core/linq/observable/merge.js', 'src/core/perf/operators/mergeall.js', 'src/core/linq/observable/mergedelayerror.js', 'src/core/perf/operators/skipuntil.js', 'src/core/perf/operators/switch.js', 'src/core/perf/operators/takeuntil.js', 'src/core/perf/operators/withlatestfrom.js', 'src/core/perf/operators/zip.js', 'src/core/linq/observable/zip.js', 'src/core/linq/observable/zipiterable.js', // Single 'src/core/linq/observable/asobservable.js', 'src/core/linq/observable/dematerialize.js', 'src/core/perf/operators/distinctuntilchanged.js', 'src/core/perf/operators/tap.js', 'src/core/perf/operators/finally.js', 'src/core/perf/operators/ignoreelements.js', 'src/core/linq/observable/materialize.js', 'src/core/linq/observable/repeatproto.js', 'src/core/linq/observable/retry.js', 'src/core/linq/observable/retrywhen.js', 'src/core/linq/observable/repeatwhen.js', 'src/core/perf/operators/scan.js', 'src/core/linq/observable/skiplast.js', 'src/core/linq/observable/startwith.js', 'src/core/linq/observable/takelast.js', // Standard Query Operators 'src/core/perf/operators/concatmap.js', 'src/core/perf/operators/map.js', 'src/core/linq/observable/pluck.js', 'src/core/perf/operators/flatmap.js', 'src/core/perf/operators/flatmaplatest.js', 'src/core/perf/operators/skip.js', 'src/core/linq/observable/skipwhile.js', 'src/core/perf/operators/take.js', 'src/core/linq/observable/takewhile.js', 'src/core/perf/operators/filter.js', // Async Operators 'src/core/perf/operators/fromcallback.js', 'src/core/perf/operators/fromnodecallback.js', 'src/core/linq/observable/fromevent.js', // publish 'src/core/linq/observable/fromeventpattern.js', // publish 'src/core/perf/operators/frompromise.js', // AsyncSubject, asObservable 'src/core/linq/observable/topromise.js', 'src/core/linq/observable/startasync.js', // Binding Operators 'src/core/linq/observable/multicast.js', // ConnectableObservable 'src/core/linq/observable/publish.js', // mulitcast, Subject 'src/core/linq/observable/share.js', // mulitcast, Subject, Reference counted 'src/core/linq/observable/publishlast.js', // multicast, AsyncSubject 'src/core/linq/observable/publishvalue.js', // multicast, BehaviorSubject 'src/core/linq/observable/sharevalue.js', // multicast, BehaviorSubject, Reference counted 'src/core/linq/observable/replay.js', // multicast, ReplaySubject 'src/core/linq/observable/sharereplay.js', 'src/core/linq/connectableobservable.js', // Time operators 'src/core/linq/observable/_observabletimer.js', // AnonymousObservable 'src/core/linq/observable/_observabletimerdateandperiod.js', // AnonymousObservable, normalizeTime 'src/core/linq/observable/_observabletimertimespanandperiod.js', // AnonymousObservable, defer, _observabletimerdateandperiod 'src/core/linq/observable/interval.js', // timeoutScheduler, _observabletimertimespanandperiod 'src/core/linq/observable/timer.js', // timeoutScheduler, _observabletimerdate, _observabletimerdateandperiod, _observabletimertimespan, _observabletimertimespanandperiod 'src/core/linq/observable/delay.js', // AnonymousObservable, timeoutScheduler, SerialDisposable, materialize, timestamp 'src/core/linq/observable/debounce.js', // AnonymousObservable, SerialDisposable, timeoutScheduler, SingleAssignmentDisposable, CompositeDisposable 'src/core/linq/observable/timestamp.js', // timeoutScheduler, select 'src/core/linq/observable/sample.js', // AnonymousObservable, CompositeDisposable, interval, timeoutScheduler 'src/core/linq/observable/timeout.js', // AnonymousObservable, timeoutScheduler, throw, SingleAssignmentDisposable, SerialDisposable, CompositeDisposable 'src/core/linq/observable/throttle.js', // Backpressure operators 'src/core/backpressure/pausable.js', 'src/core/backpressure/pausablebuffered.js', 'src/core/backpressure/controlled.js', 'src/core/linq/observable/pipe.js', // Transducers 'src/core/linq/observable/transduce.js', 'src/core/anonymousobservable.js', 'src/core/autodetachobserver.js', 'src/core/subjects/innersubscription.js', 'src/core/subjects/subject.js', 'src/core/subjects/asyncsubject.js', 'src/core/subjects/anonymoussubject.js', 'src/core/subjects/behaviorsubject.js', 'src/core/subjects/replaysubject.js', 'src/core/backpressure/pauser.js', 'src/core/headers/exports.js', // End long stack traces 'src/core/longstacktraces/longstackend.js', 'src/core/headers/outro.js', ], dest: 'dist/rx.lite.compat.js' }, 'lite-extras': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro.js', 'src/core/headers/liteextrasheader.js', 'src/core/internal/trycatch.js', 'src/core/disposables/scheduleddisposable.js', 'src/core/checkedobserver.js', 'src/core/observeonobserver.js', 'src/core/observer-extras.js', // Concurrency 'src/core/linq/observable/observeon.js', // ObserveOnObserver 'src/core/linq/observable/subscribeon.js', // SingleAssignmentDisposable, SerialDisposable, ScheduleDisposable // Creation 'src/core/linq/observable/generate.js', 'src/core/linq/observable/using.js', // Multiple 'src/core/linq/observable/ambproto.js', 'src/core/linq/observable/amb.js', 'src/core/linq/observable/onerrorresumenextproto.js', 'src/core/linq/observable/onerrorresumenext.js', // Single 'src/core/linq/observable/bufferwithcount.js', 'src/core/linq/observable/windowwithcount.js', 'src/core/linq/observable/takelastbuffer.js', // Standard Query Operators 'src/core/linq/observable/defaultifempty.js', 'src/core/linq/observable/distinct.js', 'src/core/linq/observable/singleinstance.js', 'src/core/headers/suboutro.js' ], dest: 'dist/rx.lite.extras.js' }, 'lite-extras-compat': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro-compat.js', 'src/core/headers/liteextrasheader.js', 'src/core/internal/trycatch.js', 'src/core/disposables/scheduleddisposable.js', 'src/core/checkedobserver.js', 'src/core/observeonobserver.js', 'src/core/observer-extras.js', // Concurrency 'src/core/linq/observable/observeon.js', // ObserveOnObserver 'src/core/linq/observable/subscribeon.js', // SingleAssignmentDisposable, SerialDisposable, ScheduleDisposable // Creation 'src/core/linq/observable/generate.js', 'src/core/linq/observable/using.js', // Multiple 'src/core/linq/observable/ambproto.js', 'src/core/linq/observable/amb.js', 'src/core/linq/observable/onerrorresumenextproto.js', 'src/core/linq/observable/onerrorresumenext.js', // Single 'src/core/linq/observable/bufferwithcount.js', 'src/core/linq/observable/windowwithcount.js', 'src/core/linq/observable/takelastbuffer.js', // Standard Query Operators 'src/core/linq/observable/defaultifempty.js', 'src/core/linq/observable/distinct.js', 'src/core/linq/observable/singleinstance.js', 'src/core/headers/suboutro.js' ], dest: 'dist/rx.lite.extras.compat.js' }, backpressure: { src: [ 'src/core/headers/license.js', 'src/core/headers/subintro.js', 'src/core/headers/backpressureheader.js', 'src/core/internal/trycatch.js', // Backpressure operators 'src/core/backpressure/pauser.js', 'src/core/backpressure/pausable.js', 'src/core/backpressure/pausablebuffered.js', 'src/core/backpressure/controlled.js', 'src/core/backpressure/stopandwait.js', 'src/core/backpressure/windowed.js', 'src/core/linq/observable/pipe.js', 'src/core/headers/suboutro.js' ], dest: 'dist/rx.backpressure.js' }, 'backpressure-lite': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro.js', 'src/core/headers/backpressureheader.js', 'src/core/internal/trycatch.js', // Backpressure operators 'src/core/backpressure/stopandwait.js', 'src/core/backpressure/windowed.js', 'src/core/linq/observable/pipe.js', 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-backpressure/rx.lite.backpressure.js' }, 'backpressure-lite-compat': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro-compat.js', 'src/core/headers/backpressureheader.js', 'src/core/internal/trycatch.js', // Backpressure operators 'src/core/backpressure/stopandwait.js', 'src/core/backpressure/windowed.js', 'src/core/linq/observable/pipe.js', 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-backpressure-compat/rx.lite.backpressure.compat.js' }, aggregates: { src: [ 'src/core/headers/license.js', 'src/core/headers/subintro.js', 'src/core/headers/aggregatesheader.js', 'src/core/internal/trycatch.js', 'src/core/linq/observable/_extremaby.js', 'src/core/linq/observable/_firstonly.js', 'src/core/perf/operators/reduce.js', // scan, startwith, finalvalue 'src/core/linq/observable/some.js', // where 'src/core/linq/observable/isempty.js', // any, select 'src/core/linq/observable/every.js', // where, any 'src/core/linq/observable/includes.js', // where, any 'src/core/linq/observable/count.js', // where, aggregate 'src/core/linq/observable/indexof.js', 'src/core/linq/observable/sum.js', // select, aggregate 'src/core/linq/observable/minby.js', // _extremaby 'src/core/linq/observable/min.js', // minby, _firstonly 'src/core/linq/observable/maxby.js', // _extremaby 'src/core/linq/observable/max.js', // max, _firstonly 'src/core/linq/observable/average.js', // select, scan, aggregate, finalvalue 'src/core/linq/observable/sequenceequal.js', // compositedisposable 'src/core/linq/observable/elementat.js', 'src/core/linq/observable/single.js', 'src/core/linq/observable/first.js', 'src/core/linq/observable/last.js', 'src/core/linq/observable/_findvalue.js', 'src/core/linq/observable/find.js', // _findvalue, where 'src/core/linq/observable/findindex.js', // _findvalue, where 'src/core/linq/observable/toset.js', 'src/core/linq/observable/tomap.js', 'src/core/linq/observable/slice.js', 'src/core/linq/observable/lastindexof.js', 'src/core/headers/suboutro.js' ], dest: 'dist/rx.aggregates.js' }, 'aggregates-lite': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro.js', 'src/core/headers/aggregatesheader.js', 'src/core/internal/trycatch.js', 'src/core/linq/observable/_extremaby.js', 'src/core/linq/observable/_firstonly.js', 'src/core/perf/operators/reduce.js', // scan, startwith, finalvalue 'src/core/linq/observable/some.js', // where 'src/core/linq/observable/isempty.js', // any, select 'src/core/linq/observable/every.js', // where, any 'src/core/linq/observable/includes.js', // where, any 'src/core/linq/observable/count.js', // where, aggregate 'src/core/linq/observable/indexof.js', 'src/core/linq/observable/sum.js', // select, aggregate 'src/core/linq/observable/minby.js', // _extremaby 'src/core/linq/observable/min.js', // minby, _firstonly 'src/core/linq/observable/maxby.js', // _extremaby 'src/core/linq/observable/max.js', // max, _firstonly 'src/core/linq/observable/average.js', // select, scan, aggregate, finalvalue 'src/core/linq/observable/sequenceequal.js', // compositedisposable 'src/core/linq/observable/elementat.js', 'src/core/linq/observable/single.js', 'src/core/linq/observable/first.js', 'src/core/linq/observable/last.js', 'src/core/linq/observable/_findvalue.js', 'src/core/linq/observable/find.js', // _findvalue, where 'src/core/linq/observable/findindex.js', // _findvalue, where 'src/core/linq/observable/toset.js', 'src/core/linq/observable/tomap.js', 'src/core/linq/observable/slice.js', 'src/core/linq/observable/lastindexof.js', 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-aggregates/rx.lite.aggregates.js' }, 'aggregates-lite-compat': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro-compat.js', 'src/core/headers/aggregatesheader.js', 'src/core/internal/trycatch.js', 'src/core/linq/observable/_extremaby.js', 'src/core/linq/observable/_firstonly.js', 'src/core/perf/operators/reduce.js', // scan, startwith, finalvalue 'src/core/linq/observable/some.js', // where 'src/core/linq/observable/isempty.js', // any, select 'src/core/linq/observable/every.js', // where, any 'src/core/linq/observable/includes.js', // where, any 'src/core/linq/observable/count.js', // where, aggregate 'src/core/linq/observable/indexof.js', 'src/core/linq/observable/sum.js', // select, aggregate 'src/core/linq/observable/minby.js', // _extremaby 'src/core/linq/observable/min.js', // minby, _firstonly 'src/core/linq/observable/maxby.js', // _extremaby 'src/core/linq/observable/max.js', // max, _firstonly 'src/core/linq/observable/average.js', // select, scan, aggregate, finalvalue 'src/core/linq/observable/sequenceequal.js', // compositedisposable 'src/core/linq/observable/elementat.js', 'src/core/linq/observable/single.js', 'src/core/linq/observable/first.js', 'src/core/linq/observable/last.js', 'src/core/linq/observable/_findvalue.js', 'src/core/linq/observable/find.js', // _findvalue, where 'src/core/linq/observable/findindex.js', // _findvalue, where 'src/core/linq/observable/toset.js', 'src/core/linq/observable/tomap.js', 'src/core/linq/observable/slice.js', 'src/core/linq/observable/lastindexof.js', 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-aggregates-compat/rx.lite.aggregates.compat.js' }, 'async': { src: [ 'src/core/headers/license.js', 'src/core/headers/asyncintro.js', 'src/core/headers/asyncheader.js', 'src/core/internal/trycatch.js', 'src/core/linq/observable/spawn.js', 'src/core/linq/observable/start.js', // toasync 'src/core/linq/observable/toasync.js', // AsyncSubject, asObservable 'src/core/perf/operators/fromcallback.js', 'src/core/perf/operators/fromnodecallback.js', 'src/core/linq/observable/fromevent.js', // publish 'src/core/linq/observable/fromeventpattern.js', // publish 'src/core/linq/observable/startasync.js', 'src/core/headers/suboutro.js' ], dest: 'dist/rx.async.js' }, 'async-compat': { src: [ 'src/core/headers/license.js', 'src/core/headers/asyncintro.js', 'src/core/headers/asyncheader.js', 'src/core/internal/trycatch.js', 'src/core/linq/observable/spawn.js', 'src/core/linq/observable/start.js', // toasync 'src/core/linq/observable/toasync.js', // asyncsubject, asObservable 'src/core/perf/operators/fromcallback.js', 'src/core/perf/operators/fromnodecallback.js', 'src/core/linq/observable/fromevent.js', // publish 'src/core/linq/observable/fromeventpattern.js', // publish 'src/core/linq/observable/startasync.js', 'src/core/headers/suboutro.js' ], dest: 'dist/rx.async.compat.js' }, 'async-lite': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro.js', 'src/core/headers/asyncheader.js', 'src/core/linq/observable/spawn.js', 'src/core/linq/observable/start.js', // toasync 'src/core/linq/observable/startasync.js', 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-async/rx.lite.async.js' }, 'async-lite-compat': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro-compat.js', 'src/core/headers/asyncheader.js', 'src/core/linq/observable/spawn.js', 'src/core/linq/observable/start.js', // toasync 'src/core/linq/observable/startasync.js', 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-async-compat/rx.lite.async.compat.js' }, binding: { src: [ 'src/core/headers/license.js', 'src/core/headers/subintro.js', 'src/core/headers/bindingheader.js', 'src/core/linq/observable/multicast.js', // ConnectableObservable 'src/core/linq/observable/publish.js', // mulitcast, Subject 'src/core/linq/observable/share.js', // mulitcast, Subject, Reference counted 'src/core/linq/observable/publishlast.js', // multicast, AsyncSubject 'src/core/linq/observable/publishvalue.js', // multicast, BehaviorSubject 'src/core/linq/observable/sharevalue.js', // multicast, BehaviorSubject, Reference counted 'src/core/linq/observable/replay.js', // multicast, ReplaySubject 'src/core/linq/observable/sharereplay.js', 'src/core/subjects/innersubscription.js', 'src/core/subjects/behaviorsubject.js', 'src/core/subjects/replaysubject.js', 'src/core/linq/connectableobservable.js', 'src/core/linq/observable/singleinstance.js', 'src/core/headers/suboutro.js' ], dest: 'dist/rx.binding.js' }, coincidence: { src: [ 'src/core/headers/license.js', 'src/core/headers/subintro.js', 'src/core/headers/coincidenceheader.js', 'src/core/internal/trycatch.js', 'src/core/internal/map.js', 'src/core/linq/observable/join.js', // SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, Dictionary 'src/core/linq/observable/groupjoin.js', // SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, Dictionary 'src/core/linq/observable/buffer.js', // window, selectMany, toArray 'src/core/linq/observable/window.js', // CompositeDisposable, RefCountDisposable, Subject, SingleAssignmentDisposable 'src/core/linq/observable/pairwise.js', 'src/core/linq/observable/partition.js', 'src/core/linq/observable/groupby.js', 'src/core/linq/observable/groupbyuntil.js', 'src/core/linq/groupedobservable.js', 'src/core/headers/suboutro.js' ], dest: 'dist/rx.coincidence.js' }, 'coincidence-lite': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro.js', 'src/core/headers/coincidenceheader.js', 'src/core/internal/trycatch.js', 'src/core/internal/map.js', 'src/core/linq/observable/join.js', // SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, Dictionary 'src/core/linq/observable/groupjoin.js', // SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, Dictionary 'src/core/linq/observable/buffer.js', // window, selectMany, toArray 'src/core/linq/observable/window.js', // CompositeDisposable, RefCountDisposable, Subject, SingleAssignmentDisposable 'src/core/linq/observable/pairwise.js', 'src/core/linq/observable/partition.js', 'src/core/linq/observable/groupby.js', 'src/core/linq/observable/groupbyuntil.js', 'src/core/linq/groupedobservable.js', 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-coincidence/rx.lite.coincidence.js' }, 'coincidence-lite-compat': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro-compat.js', 'src/core/headers/coincidenceheader.js', 'src/core/internal/trycatch.js', 'src/core/internal/map.js', 'src/core/linq/observable/join.js', // SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, Dictionary 'src/core/linq/observable/groupjoin.js', // SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, Dictionary 'src/core/linq/observable/buffer.js', // window, selectMany, toArray 'src/core/linq/observable/window.js', // CompositeDisposable, RefCountDisposable, Subject, SingleAssignmentDisposable 'src/core/linq/observable/pairwise.js', 'src/core/linq/observable/partition.js', 'src/core/linq/observable/groupby.js', 'src/core/linq/observable/groupbyuntil.js', 'src/core/linq/groupedobservable.js', 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-coincidence-compat/rx.lite.coincidence.compat.js' }, experimental: { src: [ 'src/core/headers/license.js', 'src/core/headers/subintro.js', 'src/core/headers/experimentalheader.js', 'src/core/internal/trycatch.js', 'src/core/headers/enumeratorheader.js', 'src/core/linq/enumerable/while.js', // Enumerable 'src/core/linq/observable/let.js', 'src/core/linq/observable/if.js', // defer, empty 'src/core/linq/observable/for.js', // Enumerable.forEach, concatproto 'src/core/linq/observable/while.js', // Enumerable.while, concatproto 'src/core/linq/observable/dowhile.js', // Enumerable.while, concat 'src/core/linq/observable/case.js', // defer, empty 'src/core/linq/observable/expand.js', // immediateScheduler, SerialDisposable, CompositeDisposable, SingleAssignmentDisposable 'src/core/linq/observable/forkjoin.js', // CompositeDisposable 'src/core/linq/observable/forkjoinproto.js', // SingleAssignmentDisposable, CompositeDisposable 'src/core/linq/observable/manyselect.js', // ImmediateScheduler, CurrentThreadScheduler, select, do, observeOn // Experimental Flattening 'src/core/linq/observable/switchfirst.js', 'src/core/perf/operators/flatmapfirst.js', 'src/core/perf/operators/flatmapwithmaxconcurrent.js', 'src/core/headers/suboutro.js' ], dest: 'dist/rx.experimental.js' }, 'experimental-lite': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro.js', 'src/core/headers/experimentalheader.js', 'src/core/internal/trycatch.js', 'src/core/headers/enumeratorheader.js', 'src/core/linq/enumerable/while.js', // Enumerable 'src/core/linq/observable/let.js', 'src/core/linq/observable/if.js', // defer, empty 'src/core/linq/observable/for.js', // Enumerable.forEach, concatproto 'src/core/linq/observable/while.js', // Enumerable.while, concatproto 'src/core/linq/observable/dowhile.js', // Enumerable.while, concat 'src/core/linq/observable/case.js', // defer, empty 'src/core/linq/observable/expand.js', // immediateScheduler, SerialDisposable, CompositeDisposable, SingleAssignmentDisposable 'src/core/linq/observable/forkjoin.js', // CompositeDisposable 'src/core/linq/observable/forkjoinproto.js', // SingleAssignmentDisposable, CompositeDisposable 'src/core/linq/observable/manyselect.js', // ImmediateScheduler, CurrentThreadScheduler, select, do, observeOn // Experimental Flattening 'src/core/linq/observable/switchfirst.js', 'src/core/perf/operators/flatmapfirst.js', 'src/core/perf/operators/flatmapwithmaxconcurrent.js', 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-experimental/rx.lite.experimental.js' }, 'experimental-lite-compat': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro-compat.js', 'src/core/headers/experimentalheader.js', 'src/core/internal/trycatch.js', 'src/core/headers/enumeratorheader.js', 'src/core/linq/enumerable/while.js', // Enumerable 'src/core/linq/observable/let.js', 'src/core/linq/observable/if.js', // defer, empty 'src/core/linq/observable/for.js', // Enumerable.forEach, concatproto 'src/core/linq/observable/while.js', // Enumerable.while, concatproto 'src/core/linq/observable/dowhile.js', // Enumerable.while, concat 'src/core/linq/observable/case.js', // defer, empty 'src/core/linq/observable/expand.js', // immediateScheduler, SerialDisposable, CompositeDisposable, SingleAssignmentDisposable 'src/core/linq/observable/forkjoin.js', // CompositeDisposable 'src/core/linq/observable/forkjoinproto.js', // SingleAssignmentDisposable, CompositeDisposable 'src/core/linq/observable/manyselect.js', // ImmediateScheduler, CurrentThreadScheduler, select, do, observeOn // Experimental Flattening 'src/core/linq/observable/switchfirst.js', 'src/core/perf/operators/flatmapfirst.js', 'src/core/perf/operators/flatmapwithmaxconcurrent.js', 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-experimental-compat/rx.lite.experimental.compat.js' }, joinpatterns: { src: [ 'src/core/headers/license.js', 'src/core/headers/subintro.js', 'src/core/headers/joinpatternsheader.js', 'src/core/internal/trycatch.js', 'src/core/internal/map.js', 'src/core/joins/pattern.js', 'src/core/joins/plan.js', 'src/core/joins/activeplan.js', 'src/core/joins/joinobserver.js', 'src/core/linq/observable/and.js', // Pattern 'src/core/linq/observable/thendo.js', // Pattern 'src/core/linq/observable/when.js', // CompositeDisposable 'src/core/headers/suboutro.js' ], dest: 'dist/rx.joinpatterns.js' }, 'joinpatterns-lite': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro.js', 'src/core/headers/joinpatternsheader.js', 'src/core/internal/trycatch.js', 'src/core/internal/map.js', 'src/core/joins/pattern.js', 'src/core/joins/plan.js', 'src/core/joins/activeplan.js', 'src/core/joins/joinobserver.js', 'src/core/linq/observable/and.js', // Pattern 'src/core/linq/observable/thendo.js', // Pattern 'src/core/linq/observable/when.js', // CompositeDisposable 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-joinpatterns/rx.lite.joinpatterns.js' }, 'joinpatterns-lite-compat': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro-compat.js', 'src/core/headers/joinpatternsheader.js', 'src/core/internal/trycatch.js', 'src/core/internal/map.js', 'src/core/joins/pattern.js', 'src/core/joins/plan.js', 'src/core/joins/activeplan.js', 'src/core/joins/joinobserver.js', 'src/core/linq/observable/and.js', // Pattern 'src/core/linq/observable/thendo.js', // Pattern 'src/core/linq/observable/when.js', // CompositeDisposable 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-joinpatterns-compat/rx.lite.joinpatterns.compat.js' }, testing: { src: [ 'src/core/headers/license.js', 'src/core/headers/testintro.js', 'src/core/headers/testheader.js', 'src/core/testing/reactivetest.js', 'src/core/testing/recorded.js', 'src/core/testing/subscription.js', 'src/core/testing/mockdisposable.js', 'src/core/testing/mockobserver.js', 'src/core/testing/mockpromise.js', 'src/core/testing/hotobservable.js', 'src/core/testing/coldobservable.js', 'src/core/testing/testscheduler.js', 'src/core/headers/suboutro.js' ], dest: 'dist/rx.testing.js' }, 'testing-lite': { src: [ 'src/core/headers/license.js', 'src/core/headers/litetestintro.js', 'src/core/headers/testheader.js', 'src/core/testing/reactivetest.js', 'src/core/testing/recorded.js', 'src/core/testing/subscription.js', 'src/core/testing/mockdisposable.js', 'src/core/testing/mockobserver.js', 'src/core/testing/mockpromise.js', 'src/core/testing/hotobservable.js', 'src/core/testing/coldobservable.js', 'src/core/testing/testscheduler.js', 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-testing/rx.lite.testing.js' }, 'testing-lite-compat': { src: [ 'src/core/headers/license.js', 'src/core/headers/litetestintro-compat.js', 'src/core/headers/testheader.js', 'src/core/testing/reactivetest.js', 'src/core/testing/recorded.js', 'src/core/testing/subscription.js', 'src/core/testing/mockdisposable.js', 'src/core/testing/mockobserver.js', 'src/core/testing/mockpromise.js', 'src/core/testing/hotobservable.js', 'src/core/testing/coldobservable.js', 'src/core/testing/testscheduler.js', 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-testing-compat/rx.lite.testing.compat.js' }, time: { src: [ 'src/core/headers/license.js', 'src/core/headers/subintro.js', 'src/core/headers/timeheader.js', 'src/core/internal/trycatch.js', 'src/core/linq/observable/_observabletimer.js', // AnonymousObservable 'src/core/linq/observable/_observabletimerdateandperiod.js', // AnonymousObservable, normalizeTime 'src/core/linq/observable/_observabletimertimespanandperiod.js', // AnonymousObservable, defer, _observabletimerdateandperiod 'src/core/linq/observable/interval.js', // timeoutScheduler, _observabletimertimespanandperiod 'src/core/linq/observable/timer.js', // timeoutScheduler, _observabletimerdate, _observabletimerdateandperiod, _observabletimertimespan, _observabletimertimespanandperiod 'src/core/linq/observable/delay.js', // AnonymousObservable, timeoutScheduler, SerialDisposable, materialize, timestamp 'src/core/linq/observable/debounce.js', // AnonymousObservable, SerialDisposable, timeoutScheduler, SingleAssignmentDisposable, CompositeDisposable 'src/core/linq/observable/windowwithtime.js', // AnonymousObservable, SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, addref, subject 'src/core/linq/observable/windowwithtimeorcount.js', // AnonymousObservable, SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, addref, subject 'src/core/linq/observable/bufferwithtime.js', // windowwithtime, selectMany, toArray 'src/core/linq/observable/bufferwithtimeorcount.js', // windowwithtimeorcount, selectMany, toArray 'src/core/linq/observable/timeinterval.js', // timeoutScheduler, defer, select 'src/core/linq/observable/timestamp.js', // timeoutScheduler, select 'src/core/linq/observable/sample.js', // AnonymousObservable, CompositeDisposable, interval, timeoutScheduler 'src/core/linq/observable/timeout.js', // AnonymousObservable, timeoutScheduler, throw, SingleAssignmentDisposable, SerialDisposable, CompositeDisposable 'src/core/linq/observable/generatewithabsolutetime.js', // timeoutScheduler, AnonymousObservable 'src/core/linq/observable/generatewithrelativetime.js', // timeoutScheduler, AnonymousObservable 'src/core/linq/observable/delaysubscription.js', // delayWithSelector, timer, empty 'src/core/linq/observable/skiplastwithtime.js', 'src/core/linq/observable/takelastwithtime.js', 'src/core/linq/observable/takelastbufferwithtime.js', 'src/core/linq/observable/takewithtime.js', 'src/core/linq/observable/skipwithtime.js', 'src/core/linq/observable/skipuntilwithtime.js', 'src/core/linq/observable/takeuntilwithtime.js', 'src/core/linq/observable/throttle.js', 'src/core/headers/suboutro.js' ], dest: 'dist/rx.time.js' }, 'time-lite': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro.js', 'src/core/headers/timeheader.js', 'src/core/internal/trycatch.js', 'src/core/linq/observable/windowwithtime.js', // AnonymousObservable, SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, addref, subject 'src/core/linq/observable/windowwithtimeorcount.js', // AnonymousObservable, SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, addref, subject 'src/core/linq/observable/bufferwithtime.js', // windowwithtime, selectMany, toArray 'src/core/linq/observable/bufferwithtimeorcount.js', // windowwithtimeorcount, selectMany, toArray 'src/core/linq/observable/timeinterval.js', // timeoutScheduler, defer, select 'src/core/linq/observable/generatewithabsolutetime.js', // timeoutScheduler, AnonymousObservable 'src/core/linq/observable/generatewithrelativetime.js', // timeoutScheduler, AnonymousObservable 'src/core/linq/observable/delaysubscription.js', // delayWithSelector, timer, empty 'src/core/linq/observable/skiplastwithtime.js', 'src/core/linq/observable/takelastwithtime.js', 'src/core/linq/observable/takelastbufferwithtime.js', 'src/core/linq/observable/takewithtime.js', 'src/core/linq/observable/skipwithtime.js', 'src/core/linq/observable/skipuntilwithtime.js', 'src/core/linq/observable/takeuntilwithtime.js', 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-time/rx.lite.time.js' }, 'time-lite-compat': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro-compat.js', 'src/core/headers/timeheader.js', 'src/core/internal/trycatch.js', 'src/core/linq/observable/windowwithtime.js', // AnonymousObservable, SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, addref, subject 'src/core/linq/observable/windowwithtimeorcount.js', // AnonymousObservable, SerialDisposable, SingleAssignmentDisposable, RefCountDisposable, CompositeDisposable, addref, subject 'src/core/linq/observable/bufferwithtime.js', // windowwithtime, selectMany, toArray 'src/core/linq/observable/bufferwithtimeorcount.js', // windowwithtimeorcount, selectMany, toArray 'src/core/linq/observable/timeinterval.js', // timeoutScheduler, defer, select 'src/core/linq/observable/generatewithabsolutetime.js', // timeoutScheduler, AnonymousObservable 'src/core/linq/observable/generatewithrelativetime.js', // timeoutScheduler, AnonymousObservable 'src/core/linq/observable/delaysubscription.js', // delayWithSelector, timer, empty 'src/core/linq/observable/skiplastwithtime.js', 'src/core/linq/observable/takelastwithtime.js', 'src/core/linq/observable/takelastbufferwithtime.js', 'src/core/linq/observable/takewithtime.js', 'src/core/linq/observable/skipwithtime.js', 'src/core/linq/observable/skipuntilwithtime.js', 'src/core/linq/observable/takeuntilwithtime.js', 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-time-compat/rx.lite.time.compat.js' }, virtualtime: { src: [ 'src/core/headers/license.js', 'src/core/headers/subintro.js', 'src/core/headers/virtualtimeheader.js', 'src/core/concurrency/virtualtimescheduler.js', 'src/core/concurrency/historicalscheduler.js', 'src/core/headers/suboutro.js' ], dest: 'dist/rx.virtualtime.js' }, 'virtualtime-lite': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro.js', 'src/core/headers/virtualtimeheader.js', 'src/core/concurrency/virtualtimescheduler.js', 'src/core/concurrency/historicalscheduler.js', 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-virtualtime/rx.lite.virtualtime.js' }, 'virtualtime-lite-compat': { src: [ 'src/core/headers/license.js', 'src/core/headers/liteintro-compat.js', 'src/core/headers/virtualtimeheader.js', 'src/core/concurrency/virtualtimescheduler.js', 'src/core/concurrency/historicalscheduler.js', 'src/core/headers/suboutro.js' ], dest: 'modules/rx-lite-virtualtime-compat/rx.lite.virtualtime.compat.js' }, sorting: { src: [ 'src/core/headers/license.js', 'src/core/headers/subintro.js', 'src/core/headers/sortingheader.js', 'src/core/linq/observable/jortsort.js', 'src/core/linq/observable/jortsortuntil.js', 'src/core/headers/suboutro.js' ], dest: 'dist/rx.sorting.js' } }, uglify: { options: { banner: '/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/' }, core: { options: { sourceMap: true, sourceMapName: 'dist/rx.core.map' }, files: {'dist/rx.core.min.js': ['dist/rx.core.js'] } }, 'core-binding': { options: { sourceMap: true, sourceMapName: 'dist/rx.core.binding.map' }, files: {'dist/rx.core.binding.min.js': ['dist/rx.core.binding.js'] } }, 'core-testing': { options: { sourceMap: true, sourceMapName: 'dist/rx.core.testing.map' }, files: {'dist/rx.core.testing.min.js': ['dist/rx.core.testing.js'] } }, all: { options: { sourceMap: true, sourceMapName: 'dist/rx.all.map' }, files: {'dist/rx.all.min.js': ['dist/rx.all.js'] } }, 'all-compat': { options: { sourceMap: true, sourceMapName: 'dist/rx.all.compat.map' }, files: {'dist/rx.all.compat.min.js': ['dist/rx.all.compat.js'] } }, main: { options: { sourceMap: true, sourceMapName: 'dist/rx.map' }, files: {'dist/rx.min.js': ['dist/rx.js'] } }, 'main-compat': { options: { sourceMap: true, sourceMapName: 'dist/rx.compat.map' }, files: {'dist/rx.compat.min.js': ['dist/rx.compat.js'] } }, lite: { options: { sourceMap: true, sourceMapName: 'dist/rx.lite.map' }, files: {'dist/rx.lite.min.js': ['dist/rx.lite.js'] } }, 'lite-compat': { options: { sourceMap: true, sourceMapName: 'dist/rx.lite.compat.map' }, files: {'dist/rx.lite.compat.min.js': ['dist/rx.lite.compat.js'] } }, 'lite-extras': { options: { sourceMap: true, sourceMapName: 'dist/rx.lite.extras.map' }, files: {'dist/rx.lite.extras.min.js': ['dist/rx.lite.extras.js'] } }, 'lite-extras-compat': { options: { sourceMap: true, sourceMapName: 'dist/rx.lite.extras.compat.map' }, files: {'dist/rx.lite.extras.compat.min.js': ['dist/rx.lite.extras.compat.js'] } }, aggregates: { options: { sourceMap: true, sourceMapName: 'dist/rx.aggregates.map' }, files: {'dist/rx.aggregates.min.js': ['dist/rx.aggregates.js'] } }, 'aggregates-lite': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-aggregates/rx.lite.aggregates.map' }, files: {'modules/rx-lite-aggregates/rx.lite.aggregates.min.js': ['modules/rx-lite-aggregates/rx.lite.aggregates.js'] } }, 'aggregates-lite-compat': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-aggregates-compat/rx.lite.aggregates.compat.map' }, files: {'modules/rx-lite-aggregates-compat/rx.lite.aggregates.compat.min.js': ['modules/rx-lite-aggregates-compat/rx.lite.aggregates.compat.js'] } }, 'async': { options: { sourceMap: true, sourceMapName: 'dist/rx.async.map' }, files: {'dist/rx.async.min.js': ['dist/rx.async.js'] } }, 'async-compat': { options: { sourceMap: true, sourceMapName: 'dist/rx.async.compat.map' }, files: {'dist/rx.async.compat.min.js': ['dist/rx.async.compat.js'] } }, 'async-lite': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-async/rx.lite.async.map' }, files: {'modules/rx-lite-async/rx.lite.async.min.js': ['modules/rx-lite-async/rx.lite.async.js'] } }, 'async-lite-compat': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-async-compat/rx.lite.async.compat.map' }, files: {'modules/rx-lite-async-compat/rx.lite.async.compat.min.js': ['modules/rx-lite-async-compat/rx.lite.async.compat.js'] } }, backpressure: { options: { sourceMap: true, sourceMapName: 'dist/rx.backpressure.map' }, files: {'dist/rx.backpressure.min.js': ['dist/rx.backpressure.js'] } }, 'backpressure-lite': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-backpressure/rx.lite.backpressure.map' }, files: {'modules/rx-lite-backpressure/rx.lite.backpressure.min.js': ['modules/rx-lite-backpressure/rx.lite.backpressure.js'] } }, 'backpressure-lite-compat': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-backpressure-compat/rx.lite.backpressure.compat.map' }, files: {'modules/rx-lite-backpressure-compat/rx.lite.backpressure.compat.min.js': ['modules/rx-lite-backpressure-compat/rx.lite.backpressure.compat.js'] } }, binding: { options: { sourceMap: true, sourceMapName: 'dist/rx.binding.map' }, files: {'dist/rx.binding.min.js': ['dist/rx.binding.js'] } }, coincidence: { options: { sourceMap: true, sourceMapName: 'dist/rx.coincidence.map' }, files: {'dist/rx.coincidence.min.js': ['dist/rx.coincidence.js'] } }, 'coincidence-lite': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-coincidence/rx.lite.coincidence.map' }, files: {'modules/rx-lite-coincidence/rx.lite.coincidence.min.js': ['modules/rx-lite-coincidence/rx.lite.coincidence.js'] } }, 'coincidence-lite-compat': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-coincidence-compat/rx.lite.coincidence.compat.map' }, files: {'modules/rx-lite-coincidence-compat/rx.lite.coincidence.compat.min.js': ['modules/rx-lite-coincidence-compat/rx.lite.coincidence.compat.js'] } }, experimental: { options: { sourceMap: true, sourceMapName: 'dist/rx.experimental.map' }, files: {'dist/rx.experimental.min.js': ['dist/rx.experimental.js'] } }, 'experimental-lite': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-experimental/rx.lite.experimental.map' }, files: {'modules/rx-lite-experimental/rx.lite.experimental.min.js': ['modules/rx-lite-experimental/rx.lite.experimental.js'] } }, 'experimental-lite-compat': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-experimental-compat/rx.lite.experimental.compat.map' }, files: {'modules/rx-lite-experimental-compat/rx.lite.experimental.compat.min.js': ['modules/rx-lite-experimental-compat/rx.lite.experimental.compat.js'] } }, joinpatterns: { options: { sourceMap: true, sourceMapName: 'dist/rx.joinpatterns.map' }, files: {'dist/rx.joinpatterns.min.js': ['dist/rx.joinpatterns.js'] } }, 'joinpatterns-lite': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-joinpatterns/rx.lite.joinpatterns.map' }, files: {'modules/rx-lite-joinpatterns/rx.lite.joinpatterns.min.js': ['modules/rx-lite-joinpatterns/rx.lite.joinpatterns.js'] } }, 'joinpatterns-lite-compat': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-joinpatterns-compat/rx.lite.joinpatterns.compat.map' }, files: {'modules/rx-lite-joinpatterns-compat/rx.lite.joinpatterns.compat.min.js': ['modules/rx-lite-joinpatterns-compat/rx.lite.joinpatterns.compat.js'] } }, testing: { options: { sourceMap: true, sourceMapName: 'dist/rx.testing.map' }, files: {'dist/rx.testing.min.js': ['dist/rx.testing.js'] } }, 'testing-lite': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-testing/rx.lite.testing.map' }, files: {'modules/rx-lite-testing/rx.lite.testing.min.js': ['modules/rx-lite-testing/rx.lite.testing.js'] } }, 'testing-lite-compat': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-testing-compat/rx.lite.testing.compat.map' }, files: {'modules/rx-lite-testing-compat/rx.lite.testing.compat.min.js': ['modules/rx-lite-testing-compat/rx.lite.testing.compat.js'] } }, time: { options: { sourceMap: true, sourceMapName: 'dist/rx.time.map' }, files: {'dist/rx.time.min.js': ['dist/rx.time.js'] } }, 'time-lite': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-time/rx.lite.time.map' }, files: {'modules/rx-lite-time/rx.lite.time.min.js': ['modules/rx-lite-time/rx.lite.time.js'] } }, 'time-lite-compat': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-time-compat/rx.lite.time.compat.map' }, files: {'modules/rx-lite-time-compat/rx.lite.time.compat.min.js': ['modules/rx-lite-time-compat/rx.lite.time.compat.js'] } }, virtualtime: { options: { sourceMap: true, sourceMapName: 'dist/rx.virtualtime.map' }, files: {'dist/rx.virtualtime.min.js': ['dist/rx.virtualtime.js'] } }, 'virtualtime-lite': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-virtualtime/rx.lite.virtualtime.map' }, files: {'modules/rx-lite-virtualtime/rx.lite.virtualtime.min.js': ['modules/rx-lite-virtualtime/rx.lite.virtualtime.js'] } }, 'virtualtime-lite-compat': { options: { sourceMap: true, sourceMapName: 'modules/rx-lite-virtualtime-compat/rx.lite.virtualtime.compat.map' }, files: {'modules/rx-lite-virtualtime-compat/rx.lite.virtualtime.compat.min.js': ['modules/rx-lite-virtualtime-compat/rx.lite.virtualtime.compat.js'] } }, sorting: { options: { sourceMap: true, sourceMapName: 'dist/rx.sorting.map' }, files: {'dist/rx.sorting.min.js': ['dist/rx.sorting.js'] } } }, qunit: { all: ['tests/*.html'] }, jshint: { all: [ 'rx.all.js' ] }, jscs: { src: 'src/**/*.js', options: { config: '.jscsrc' } }, watch: { scripts: { files: 'src/**/*.js', tasks: ['default'], options: { interrupt: true } } }, copy: { 'lite': { flatten: true, filter: 'isFile', expand: true, src: [ 'dist/rx.lite.js', 'dist/rx.lite.map', 'dist/rx.lite.min.js' ], dest: 'modules/rx-lite/' }, 'lite-compat': { flatten: true, filter: 'isFile', expand: true, src: [ 'dist/rx.lite.compat.js', 'dist/rx.lite.compat.map', 'dist/rx.lite.compat.min.js' ], dest: 'modules/rx-lite-compat/' }, 'lite-extras': { flatten: true, filter: 'isFile', expand: true, src: [ 'dist/rx.lite.extras.js', 'dist/rx.lite.extras.map', 'dist/rx.lite.extras.min.js' ], dest: 'modules/rx-lite-extras/' }, 'lite-extras-compat': { flatten: true, filter: 'isFile', expand: true, src: [ 'dist/rx.lite.extras.compat.js', 'dist/rx.lite.extras.compat.map', 'dist/rx.lite.extras.compat.min.js' ], dest: 'modules/rx-lite-extras-compat/' }, 'core': { flatten: true, filter: 'isFile', expand: true, src: [ 'dist/rx.core.js', 'dist/rx.core.map', 'dist/rx.core.min.js' ], dest: 'modules/rx-core/' }, 'core-binding': { flatten: true, filter: 'isFile', expand: true, src: [ 'dist/rx.core.binding.js', 'dist/rx.core.binding.map', 'dist/rx.core.binding.min.js' ], dest: 'modules/rx-core-binding/' }, 'core-testing': { flatten: true, filter: 'isFile', expand: true, src: [ 'dist/rx.core.testing.js', 'dist/rx.core.testing.map', 'dist/rx.core.testing.min.js' ], dest: 'modules/rx-core-testing/' } } }); // Load all "grunt-*" tasks require('load-grunt-tasks')(grunt); function createNuGetPackage(nuspec) { var done = this.async(); //invoke nuget.exe grunt.util.spawn({ cmd: ".nuget/nuget.exe", args: [ //specify the .nuspec file "pack", nuspec, //specify where we want the package to be created "-OutputDirectory", "nuget", //override the version with whatever is currently defined in package.json "-Version", grunt.config.get("pkg").version ] }, function (error, result) { if (error) { grunt.log.error(error); } else { grunt.log.write(result); } done(); }); } grunt.registerTask('nuget-complete', 'Register NuGet-Complete', function () { createNuGetPackage.call(this, 'nuget/RxJS-Complete/RxJS-Complete.nuspec'); }); grunt.registerTask('nuget-aggregates', 'Register NuGet-Aggregates', function () { createNuGetPackage.call(this, 'nuget/RxJS-Aggregates/RxJS-Aggregates.nuspec'); }); grunt.registerTask('nuget-all', 'Register NuGet-All', function () { createNuGetPackage.call(this, 'nuget/RxJS-All/RxJS-All.nuspec'); }); grunt.registerTask('nuget-async', 'Register NuGet-Async', function () { createNuGetPackage.call(this, 'nuget/RxJS-Async/RxJS-Async.nuspec'); }); grunt.registerTask('nuget-backpressure', 'Register NuGet-BackPressure', function () { createNuGetPackage.call(this, 'nuget/RxJS-BackPressure/RxJS-BackPressure.nuspec'); }); grunt.registerTask('nuget-binding', 'Register NuGet-Binding', function () { createNuGetPackage.call(this, 'nuget/RxJS-Binding/RxJS-Binding.nuspec'); }); grunt.registerTask('nuget-coincidence', 'Register NuGet-Coincidence', function () { createNuGetPackage.call(this, 'nuget/RxJS-Coincidence/RxJS-Coincidence.nuspec'); }); grunt.registerTask('nuget-experimental', 'Register NuGet-Experimental', function () { createNuGetPackage.call(this, 'nuget/RxJS-Experimental/RxJS-Experimental.nuspec'); }); grunt.registerTask('nuget-joinpatterns', 'Register NuGet-JoinPatterns', function () { createNuGetPackage.call(this, 'nuget/RxJS-JoinPatterns/RxJS-JoinPatterns.nuspec'); }); grunt.registerTask('nuget-lite', 'Register NuGet-Lite', function () { createNuGetPackage.call(this, 'nuget/RxJS-Lite/RxJS-Lite.nuspec'); }); grunt.registerTask('nuget-main', 'Register NuGet-Main', function () { createNuGetPackage.call(this, 'nuget/RxJS-Main/RxJS-Main.nuspec'); }); grunt.registerTask('nuget-testing', 'Register NuGet-Testing', function () { createNuGetPackage.call(this, 'nuget/RxJS-Testing/RxJS-Testing.nuspec'); }); grunt.registerTask('nuget-time', 'Register NuGet-Time', function () { createNuGetPackage.call(this, 'nuget/RxJS-Time/RxJS-Time.nuspec'); }); grunt.registerTask('nuget-virtualtime', 'Register NuGet-VirtualTime', function () { createNuGetPackage.call(this, 'nuget/RxJS-VirtualTime/RxJS-VirtualTime.nuspec'); }); grunt.registerTask('nuget', [ 'nuget-complete', 'nuget-aggregates', 'nuget-all', 'nuget-async', 'nuget-backpressure', 'nuget-binding', 'nuget-coincidence', 'nuget-experimental', 'nuget-joinpatterns', 'nuget-lite', 'nuget-main', 'nuget-testing', 'nuget-time', 'nuget-virtualtime' ]); grunt.registerTask('rebuild-ts', 'Rebuild typescript declarations', function() { var path = require('path'); var fs = require('fs'); var cache = {}; var dependencies = {}; var concatItems = grunt.config.get('concat'); var allLoadedFiles = {}; function loadFile(tsFile) { if (cache[tsFile]) { return; } var dependencyRegex = /\/\/\/ /g; var c; //, count = 0; var source = grunt.file.read(tsFile); // source with tests var s = source.match(/module Rx \{([\s\S]*)\}[\s\S]*\(function\s*\(\)\s*\{[\s\S]*\}\)/); if (s && s[1]) { c = cache[tsFile] = s[1]; } if (!s) { // source without tests s = source.match(/module Rx \{([\s\S]*)\}/); if (s && s[1]) { c = cache[tsFile] = s[1]; } } var deps = dependencies[tsFile] = []; var result; while (result = dependencyRegex.exec(source)) { var dep = path.resolve(__dirname, path.dirname(tsFile), result[1]) .substr(__dirname.length + 1) .replace(/\\/g, '/'); if (tsFile.indexOf('/testscheduler.ts') > -1 && dep.indexOf('virtualtimescheduler.ts') > -1) { continue; } deps.push(dep); loadFile(dep); } return c; } function addLoadedFile(concatKey, tsFile) { if (loadedFiles[tsFile]) { return; } if (!(concatKey === 'all' || concatKey === 'main' || concatKey === 'lite' || concatKey === 'core')) { if ((concatKey.indexOf('lite') === 0 && allLoadedFiles['lite'][tsFile]) || (concatKey.indexOf('lite') !== 0 && allLoadedFiles['main'][tsFile]) || allLoadedFiles['core'][tsFile]) { loadedFiles[tsFile] = true; return; } } if (!(tsFile.match(/\/toset\.ts$/) || tsFile.match(/\/tomap\.ts$/))) { output.push(cache[tsFile]); } es6Output.push(cache[tsFile]); loadedFiles[tsFile] = true; } function addFileContent(concatKey, tsFile) { if (loadedFiles[tsFile]) { return; } var deps = dependencies[tsFile]; for (var k = 0; k < deps.length; k++) { addLoadedFile(concatKey, deps[k]); addFileContent(concatKey, deps[k]); } addLoadedFile(concatKey, tsFile); } loadFile('ts/core/es5.ts'); loadFile('ts/core/es6.ts'); var items = []; for (var key in concatItems) { if (key.indexOf('-compat') > -1) { continue; } if (key === 'lite' || key === 'main' || key === 'core') { items.unshift(key); } else { items.push(key); } } for (var key = 0; key < items.length; key++) { var concatKey = items[key]; if (!allLoadedFiles[concatKey]) allLoadedFiles[concatKey] = {}; var loadedFiles = allLoadedFiles[concatKey]; var output = []; var es6Output = []; var value = concatItems[concatKey]; var src = value.src; var dest = value.dest; var dist = false; if (dest.indexOf('dist/') === 0) { dist = dest.match(/dist\/(.*?)\.js/)[1]; dest = dest.replace(/dist\/(.*?)\.js/, 'ts/$1.d.ts'); } else if (dest.indexOf('modules/') === 0) { continue; } else { throw new Error("not sure how to handle " + dest); } for (var i = 0; i < src.length; i++) { var file = src[i]; var tsFile = file .replace(/src\/(.*?).js/, 'ts/$1.ts') // Is this right 100% of the time? .replace('perf/operators', 'linq/observable'); if (cache[tsFile] || fs.existsSync(tsFile)) { if (!cache[tsFile]) { loadFile(tsFile); } if (tsFile.indexOf('/es5') === -1 || tsFile.indexOf('/es6') === -1) { addFileContent(concatKey, tsFile); } } else { var valid = ['/headers/', '/longstacktraces/', '/internal/', '/autodetachobserver', '/subjects/innersubscription', '/perf/observablebase', 'linq/enumerable/while', '.compat.', 'linq/observable/_', '/linq/observable/fromarrayobservable', '/joins/', '/linq/observable/flatmapbase', '/disposables/scheduleddisposable', '/concurrency/catchscheduler', '/core/observeonobserver', '/testing/mockpromise', '/testing/hotobservable', '/testing/coldobservable']; var validResult = false; for (var z = 0; z < valid.length; z++) { if (tsFile.indexOf(valid[z]) !== -1) { validResult = true; break; } } } } var writeOut = function(dest, output, es6) { var outputString = 'declare module Rx {\n' + output.join('') + '\n}\n'; if (concatKey === 'all' || concatKey === 'main' || concatKey === 'lite' || concatKey === 'core') { outputString += '\ndeclare module "rx" { export = Rx; }\n'; } if (dist && concatKey !== 'core' && concatKey !== 'main') { outputString += 'declare module "'+dist+'" { export = Rx; }'; } outputString = outputString + '\n'; grunt.file.write(dest, outputString); }; if (concatKey === 'all' || concatKey === 'main' || concatKey === 'lite' || concatKey === 'core') { output.unshift(cache['ts/core/es5.ts']); es6Output.unshift(cache['ts/core/es6.ts']); } writeOut(dest, output); writeOut(dest.replace(/.d.ts$/, '.es6.d.ts'), es6Output, true); } grunt.file.write('ts/iterable.es6.d.ts', grunt.file.read('ts/core/es6-iterable.d.ts')); grunt.file.write('ts/es6-promise.es6.d.ts', grunt.file.read('ts/core/es6-promise.d.ts')); }); grunt.registerTask('concat-min', [ 'concat:core', 'concat:core-binding', 'concat:core-testing', 'concat:all', 'concat:all-compat', 'concat:main', 'concat:main-compat', 'concat:aggregates', 'concat:aggregates-lite', 'concat:aggregates-lite-compat', 'concat:async', 'concat:async-compat', 'concat:async-lite', 'concat:async-lite-compat', 'concat:backpressure', 'concat:backpressure-lite', 'concat:backpressure-lite-compat', 'concat:binding', 'concat:coincidence', 'concat:coincidence-lite', 'concat:coincidence-lite-compat', 'concat:experimental', 'concat:experimental-lite', 'concat:experimental-lite-compat', 'concat:joinpatterns', 'concat:joinpatterns-lite', 'concat:joinpatterns-lite-compat', 'concat:lite', 'concat:lite-compat', 'concat:lite-extras', 'concat:lite-extras-compat', 'concat:time', 'concat:time-lite', 'concat:time-lite-compat', 'concat:testing', 'concat:testing-lite', 'concat:testing-lite-compat', 'concat:virtualtime', 'concat:virtualtime-lite', 'concat:virtualtime-lite-compat', 'concat:sorting', 'uglify:core', 'uglify:core-binding', 'uglify:core-testing', 'uglify:all', 'uglify:all-compat', 'uglify:main', 'uglify:main-compat', 'uglify:aggregates', 'uglify:aggregates-lite', 'uglify:aggregates-lite-compat', 'uglify:async', 'uglify:async-compat', 'uglify:async-lite', 'uglify:async-lite-compat', 'uglify:backpressure', 'uglify:backpressure-lite', 'uglify:backpressure-lite-compat', 'uglify:binding', 'uglify:coincidence', 'uglify:coincidence-lite', 'uglify:coincidence-lite-compat', 'uglify:experimental', 'uglify:experimental-lite', 'uglify:experimental-lite-compat', 'uglify:joinpatterns', 'uglify:joinpatterns-lite', 'uglify:joinpatterns-lite-compat', 'uglify:lite', 'uglify:lite-compat', 'uglify:lite-extras', 'uglify:lite-extras-compat', 'uglify:time', 'uglify:time-lite', 'uglify:time-lite-compat', 'uglify:testing', 'uglify:testing-lite', 'uglify:testing-lite-compat', 'uglify:virtualtime', 'uglify:virtualtime-lite', 'uglify:virtualtime-lite-compat', 'uglify:sorting', 'copy:lite', 'copy:lite-compat', 'copy:lite-extras', 'copy:lite-extras-compat', 'copy:core', 'copy:core-binding', 'copy:core-testing' ]); // Default task grunt.registerTask('default', [ 'concat:core', 'concat:core-binding', 'concat:core-testing', 'concat:all', 'concat:all-compat', 'concat:main', 'concat:main-compat', 'concat:aggregates', 'concat:aggregates-lite', 'concat:aggregates-lite-compat', 'concat:async', 'concat:async-compat', 'concat:async-lite', 'concat:async-lite-compat', 'concat:backpressure', 'concat:backpressure-lite', 'concat:backpressure-lite-compat', 'concat:binding', 'concat:coincidence', 'concat:coincidence-lite', 'concat:coincidence-lite-compat', 'concat:experimental', 'concat:experimental-lite', 'concat:experimental-lite-compat', 'concat:joinpatterns', 'concat:joinpatterns-lite', 'concat:joinpatterns-lite-compat', 'concat:lite', 'concat:lite-compat', 'concat:lite-extras', 'concat:lite-extras-compat', 'concat:time', 'concat:time-lite', 'concat:time-lite-compat', 'concat:testing', 'concat:testing-lite', 'concat:testing-lite-compat', 'concat:virtualtime', 'concat:virtualtime-lite', 'concat:virtualtime-lite-compat', 'concat:sorting', 'uglify:core', 'uglify:core-binding', 'uglify:core-testing', 'uglify:all', 'uglify:all-compat', 'uglify:main', 'uglify:main-compat', 'uglify:aggregates', 'uglify:aggregates-lite', 'uglify:aggregates-lite-compat', 'uglify:async', 'uglify:async-compat', 'uglify:async-lite', 'uglify:async-lite-compat', 'uglify:backpressure', 'uglify:backpressure-lite', 'uglify:backpressure-lite-compat', 'uglify:binding', 'uglify:coincidence', 'uglify:coincidence-lite', 'uglify:coincidence-lite-compat', 'uglify:experimental', 'uglify:experimental-lite', 'uglify:experimental-lite-compat', 'uglify:joinpatterns', 'uglify:joinpatterns-lite', 'uglify:joinpatterns-lite-compat', 'uglify:lite', 'uglify:lite-compat', 'uglify:lite-extras', 'uglify:lite-extras-compat', 'uglify:time', 'uglify:time-lite', 'uglify:time-lite-compat', 'uglify:testing', 'uglify:testing-lite', 'uglify:testing-lite-compat', 'uglify:virtualtime', 'uglify:virtualtime-lite', 'uglify:virtualtime-lite-compat', 'uglify:sorting', 'copy:lite', 'copy:lite-compat', 'copy:lite-extras', 'copy:lite-extras-compat', 'copy:core', 'copy:core-binding', 'copy:core-testing', 'qunit', 'rebuild-ts' ]); }; ================================================ FILE: authors.txt ================================================ Matthew Podwysocki Bart de Smet Erik Meijer ================================================ FILE: bower.json ================================================ { "name": "rxjs", "main": "dist/rx.all.js", "repository": { "type": "git", "url": "https://github.com/Reactive-Extensions/RxJS.git" }, "license": "Apache-2.0", "ignore": [ ".sh", ".*", "*.bat", "*.md", "*.txt", "*.log", "package.json", "node_modules", "doc", "examples", "src", "tests" ] } ================================================ FILE: code-of-conduct.md ================================================ # Code of Conduct # [_Adapted from the Rust Code of Conduct_](https://github.com/rust-lang/rust/wiki/Note-development-policy#conduct) We are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, disability, ethnicity, religion, or similar personal characteristic. - On any communication medium, please avoid using overtly sexual nicknames or other nicknames that might detract from a friendly, safe and welcoming environment for all. - Please be kind and courteous. There's no need to be mean or rude. - Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer. - Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works. - We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behavior. We interpret the term "harassment" as including the definition in the [Citizen Code of Conduct](http://citizencodeofconduct.org/); if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don't tolerate behavior that excludes people in socially marginalized groups. - Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one the RxJS team immediately. Whether you're a regular contributor or a newcomer, we care about making this community a safe place for you and we've got your back. - Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome. ================================================ FILE: component.json ================================================ { "name": "rx", "scripts": [ "dist/rx.aggregates.js", "dist/rx.aggregates.map", "dist/rx.aggregates.min.js", "dist/rx.all.compat.js", "dist/rx.all.compat.map", "dist/rx.all.compat.min.js", "dist/rx.all.js", "dist/rx.all.min.js", "dist/rx.all.map", "dist/rx.async.js", "dist/rx.async.map", "dist/rx.async.min.js", "dist/rx.async.compat.js", "dist/rx.async.compat.map", "dist/rx.async.compat.min.js", "dist/rx.backpressure.js", "dist/rx.backpressure.map", "dist/rx.backpressure.min.js", "dist/rx.backpressure.js", "dist/rx.backpressure.map", "dist/rx.backpressure.min.js", "dist/rx.binding.js", "dist/rx.binding.map", "dist/rx.binding.min.js", "dist/rx.coincidence.js", "dist/rx.coincidence.map", "dist/rx.coincidence.min.js", "dist/rx.js", "dist/rx.map", "dist/rx.min.js", "dist/rx.compat.js", "dist/rx.compat.map", "dist/rx.compat.min.js", "dist/rx.experimental.js", "dist/rx.experimental.map", "dist/rx.experimental.min.js", "dist/rx.joinpatterns.js", "dist/rx.joinpatterns.map", "dist/rx.joinpatterns.min.js", "dist/rx.lite.js", "dist/rx.lite.map", "dist/rx.lite.min.js", "dist/rx.lite.compat.js", "dist/rx.lite.compat.map", "dist/rx.lite.compat.min.js", "dist/rx.lite.extras.js", "dist/rx.lite.extras.map", "dist/rx.lite.extras.min.js", "dist/rx.testing.js", "dist/rx.testing.map", "dist/rx.testing.min.js", "dist/rx.time.js", "dist/rx.time.map", "dist/rx.time.min.js", "dist/rx.virtualtime.js", "dist/rx.virtualtime.map", "dist/rx.virtualtime.min.js" ] } ================================================ FILE: contributing.md ================================================ # Contributing to RxJS # Want to contribute to the Reactive Extensions for JavaScript (RxJS)? There are many ways of helping whether contributing code, documentation, examples, podcasts, videos and presentations. # Get Involved! In [the issue tracker](https://github.com/Reactive-Extensions/RxJS/issues), bugs can only be assigned to people who have commit access. Also, we aspire to make as many bugs as possible "owned" by assigning them to a core Rx contributor. Therefore, just because a bug is assigned doesn't mean it's being actively worked on. We (the core contributors) are all busy, and welcome help from the community. If you see a bug you'd like to work on that's assigned but appears to be dormant, communicate with the bug's owner with an @-reply in a comment on the issue page. If you see a bug you'd like to work on that's unassigned, it's fair game: comment to say you'd like to work on it so that we know it's getting attention. # Pull Requests To make a pull request, you will need a GitHub account; if you're unclear on this process, see GitHub's documentation on [forking](https://help.github.com/articles/fork-a-repo/) and [pull requests](https://help.github.com/articles/using-pull-requests). Pull requests should be targeted at RxJS's master branch. Before pushing to your Github repo and issuing the pull request, please do two things: 1. Rebase your local changes against the master branch. Resolve any conflicts that arise. 2. Run the full RxJS test suite by running `grunt` in the root of the repository. Pull requests will be treated as "review requests", and we will give feedback we expect to see corrected on style and substance before pulling. Changes contributed via pull request should focus on a single issue at a time, like any other. We will not look kindly on pull-requests that try to "sneak" unrelated changes in. Note for bug fixes, regression tests should be included, denoted by Issue Number so that we have full traceability. # What Are We Looking For? For documentation, we are looking for the following: - API Documentation that is missing or out of date - "How Do I?" examples - Comparison to other libraries - Comparison to Promises - Introduction material - Tutorials For coding, we have strict standards that must be adhere to when working on RxJS. In order for us to accept pull requests, they must abide by the following: - [Coding Standard](#coding-standard) - [Tests](#tests) - [Documentation](#documentation) ## Coding Standard For RxJS, we follow the [Google JavaScript Style Guide](http://google.github.io/styleguide/jsguide.html) and adhere to it strictly in areas such as documentation using JSDoc. The only exception to extending native prototypes is to polyfill behavior which may not exist in all browsers yet, for example, many of the [Array#extras](http://blogs.msdn.com/b/ie/archive/2010/12/13/ecmascript-5-part-2-array-extras.aspx) are implemented in compatibility builds. We also strictly follow [our design guidelines](https://github.com/Reactive-Extensions/RxJS/tree/master/doc/designguidelines) as well. ### Supporting Multiple Platforms RxJS runs on a number of platforms and supports many styles of programming. RxJS supports [Universal Module Definition (UMD)](https://github.com/umdjs/umd) which allows the library to work in a number of environments such as [Asynchronous Module Definition (AMD)](https://github.com/amdjs/amdjs-api/wiki/AMD), [CommonJS](http://wiki.commonjs.org/wiki/CommonJS), [Node.js](http://nodejs.org), [RingoJS](http://ringojs.org/), [Narwhal](https://github.com/280north/narwhal), the browser and other environments such as [Windows Script Host (WSH)](http://msdn.microsoft.com/en-us/library/9bbdkx3k.aspx) and embedded devices such as [Tessel](http://tessel.io). RxJS is committed to using the latest JavaScript standards as they start to arrive, for example, supporting generators, Maps, Sets, and Observable versions of new Array methods. We also are committed to supporting legacy code as well through compatibility builds, even supporting browsers back to IE6, Firefox 3, and older versions of Node.js. Should behavior not exist in those platforms, that behavior must be polyfilled, and made available in `*.compat.js` files only. For example, we have `rx.lite.js` which supports modern browsers greater than or equal to IE9, and `rx.lite.compat.js` for older browsers before IE9 and modern Firefox builds. In special cases such as event handling is different, we must provide a mainstream version of the file as well as a compat file, the latter which is included in the compat file. ### Implementing Custom Operators We welcome custom operators to RxJS if they make sense in the core RxJS, as opposed to belonging in user land. There are a number of rules that must be adhered to when implementing a custom operator including: - Prefer composition over implementing a totally new operator from scratch - If the operator introduces any notion of concurrency, then a scheduler must introduced. Usage of concurrency primitives such as `setTimeout`, `setInterval`, etc are forbidden. This is to ensure easy testability. - The scheduler must be optional with the appropriate default picked - `Rx.Scheduler.immediate` for any immediate blocking operations - `Rx.Scheduler.currentThread` for any immediate blocking operators that require re-entrant behavior such as recursive scheduling. - `Rx.Scheduler.timeout` for any operator that has a notion of time To make this concrete, let's implement a custom operator such as an implementation of `_.reject` from [Underscore.js](http://underscorejs.org/) / [Lo-Dash](http://lodash.com/). ```js /** * The opposite of _.filter this method returns the elements of a collection that the callback does **not** return truthy for. * @param {Function} [callback] The function called per iteration. * @param {Any} [thisArg] The this binding of callback. * @returns {Observable} An Observable sequence which contains items that the callback does not return truthy for. */ Rx.Observable.prototype.reject = function (callback, thisArg) { callback || (callback = Rx.helpers.identity); var source = this; return new Rx.AnonymousObservable(function (observer) { var i = 0; return source.subscribe( function (x) { var noYield = true; try { noYield = callback.call(thisArg, x, i++, source); } catch (e) { observer.onError(e); return; } if (!noYield) { observer.onNext(x); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer) ); }); }; ``` Of course, we could have implemented this using composition as well, such as using `Rx.Observable.prototype.filter`. ```js /** * The opposite of _.filter this method returns the elements of a collection that the callback does **not** return truthy for. * @param {Function} [callback] The function called per iteration. * @param {Any} [thisArg] The this binding of callback. * @returns {Observable} An Observable sequence which contains items that the callback does not return truthy for. */ Rx.Observable.prototype.reject = function (callback, thisArg) { callback || (callback = Rx.helpers.identity); return this.filter(function (x, i, o) { return !callback.call(thisArg, x, i o); }); }; ``` To show an operator that introduces a level of concurrency, let's implement a custom operator such as an implementation of `_.pairs` from [Underscore.js](http://underscorejs.org/) / [Lo-Dash](http://lodash.com/). Note that since this requires recursion to implement properly, we'll use the `Rx.Scheduler.currentThread` scheduler. ```js var keysFunction = Object.keys || someKeysPolyfill; /** * Creates an Observable with an of an object’s key-value pairs. * @param {Object} obj The object to inspect. * @returns {Observable} An Observable with an of an object’s key-value pairs. */ Rx.Observable.pairs = function (obj, scheduler) { scheduler || (scheduler = Rx.Scheduler.currentThread); return new Rx.AnonymousObservable(function (observer) { var keys = keysFunction(object), i = 0, len = keys.length; return scheduler.scheduleRecursive(function (self) { if (i < len) { var key = keys[i++], value = obj[key]; observer.onNext([key, value]); self(); } else { observer.onCompleted(); } }); }); }; ``` Note that all operators must have the documentation and must be split out into its own file. This allows us to be able to put it in different files, or make it available in custom builds. ## Tests When a new operator is written for RxJS, in order to accepted, must be accompanied by tests. RxJS currently uses [QUnit](http://qunitjs.com/) as a straight forward way to test our code. These tests are automatically executed by our [Grunt](http://gruntjs.com/) setup to concatenate files, minimize, create source maps, and finally run all the tests in the [tests folder](https://github.com/Reactive-Extensions/RxJS/tree/master/tests). Each file that we produce, for example, `rx.js` has an accompanying test file such as `rx.html`, which includes tests for all operators included in that file. Each operator under test must be in its own file to cover the following cases: - Never - Empty - Single/Multiple Values - Error in the sequence - Never ending sequences - Early disposal in sequences If the operator has a callback, then it must cover the following cases: - Success with all values in the callback - Success with the context, if any allowed in the operator signature - If an error is thrown To get a good feeling on what kind of rigor is required for testing, check out the following examples: - [`concatMap`](https://github.com/Reactive-Extensions/RxJS/blob/master/tests/observable/concatmap.js) - [`from`](https://github.com/Reactive-Extensions/RxJS/blob/master/tests/observable/from.js) ## Documentation Documentation is also a must, as all external operators and types must be documented and put in the [API Folder](https://github.com/Reactive-Extensions/RxJS/tree/master/doc/api). Each operator on an Observable must have its own file in the [Operators Folder](https://github.com/Reactive-Extensions/RxJS/tree/master/doc/api/core/operators). For operators, they must be linked from the [`Observable`](https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/observable.md) API document. In addition, each operator must be listed in which file it belongs in the [Libraries Folder](https://github.com/Reactive-Extensions/RxJS/tree/master/doc/libraries). The standard format of operators must be such as the [`of`](https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/of.md) operator which includes: - File Location - Method signature - Method description - List of Arguments - Return type (if there is one) - An example - File Distribution(s) - NuGet Distribution - NPM Distribution - Unit Tests ================================================ FILE: dist/rx.aggregates.js ================================================ // Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. ;(function (factory) { var objectTypes = { 'function': true, 'object': true }; function checkGlobal(value) { return (value && value.Object === Object) ? value : null; } var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); var freeSelf = checkGlobal(objectTypes[typeof self] && self); var freeWindow = checkGlobal(objectTypes[typeof window] && window); var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; var thisGlobal = checkGlobal(objectTypes[typeof this] && this); var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); // Because of build optimizers if (typeof define === 'function' && define.amd) { define(['./rx'], function (Rx, exports) { return factory(root, exports, Rx); }); } else if (typeof module === 'object' && module && module.exports === freeExports) { module.exports = factory(root, module.exports, require('./rx')); } else { root.Rx = factory(root, {}, root.Rx); } }.call(this, function (root, exp, Rx, undefined) { // References var Observable = Rx.Observable, observableProto = Observable.prototype, BinaryDisposable = Rx.BinaryDisposable, AnonymousObservable = Rx.AnonymousObservable, AbstractObserver = Rx.internals.AbstractObserver, disposableEmpty = Rx.Disposable.empty, helpers = Rx.helpers, defaultComparer = helpers.defaultComparer, identity = helpers.identity, defaultSubComparer = helpers.defaultSubComparer, isFunction = helpers.isFunction, isPromise = helpers.isPromise, isArrayLike = helpers.isArrayLike, isIterable = helpers.isIterable, inherits = Rx.internals.inherits, observableFromPromise = Observable.fromPromise, observableFrom = Observable.from, bindCallback = Rx.internals.bindCallback, EmptyError = Rx.EmptyError, ObservableBase = Rx.ObservableBase, ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError; var errorObj = {e: {}}; function tryCatcherGen(tryCatchTarget) { return function tryCatcher() { try { return tryCatchTarget.apply(this, arguments); } catch (e) { errorObj.e = e; return errorObj; } }; } var tryCatch = Rx.internals.tryCatch = function tryCatch(fn) { if (!isFunction(fn)) { throw new TypeError('fn must be a function'); } return tryCatcherGen(fn); }; function thrower(e) { throw e; } var ExtremaByObservable = (function (__super__) { inherits(ExtremaByObservable, __super__); function ExtremaByObservable(source, k, c) { this.source = source; this._k = k; this._c = c; __super__.call(this); } ExtremaByObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new ExtremaByObserver(o, this._k, this._c)); }; return ExtremaByObservable; }(ObservableBase)); var ExtremaByObserver = (function (__super__) { inherits(ExtremaByObserver, __super__); function ExtremaByObserver(o, k, c) { this._o = o; this._k = k; this._c = c; this._v = null; this._hv = false; this._l = []; __super__.call(this); } ExtremaByObserver.prototype.next = function (x) { var key = tryCatch(this._k)(x); if (key === errorObj) { return this._o.onError(key.e); } var comparison = 0; if (!this._hv) { this._hv = true; this._v = key; } else { comparison = tryCatch(this._c)(key, this._v); if (comparison === errorObj) { return this._o.onError(comparison.e); } } if (comparison > 0) { this._v = key; this._l = []; } if (comparison >= 0) { this._l.push(x); } }; ExtremaByObserver.prototype.error = function (e) { this._o.onError(e); }; ExtremaByObserver.prototype.completed = function () { this._o.onNext(this._l); this._o.onCompleted(); }; return ExtremaByObserver; }(AbstractObserver)); function firstOnly(x) { if (x.length === 0) { throw new EmptyError(); } return x[0]; } var ReduceObservable = (function(__super__) { inherits(ReduceObservable, __super__); function ReduceObservable(source, accumulator, hasSeed, seed) { this.source = source; this.accumulator = accumulator; this.hasSeed = hasSeed; this.seed = seed; __super__.call(this); } ReduceObservable.prototype.subscribeCore = function(observer) { return this.source.subscribe(new ReduceObserver(observer,this)); }; return ReduceObservable; }(ObservableBase)); var ReduceObserver = (function (__super__) { inherits(ReduceObserver, __super__); function ReduceObserver(o, parent) { this._o = o; this._p = parent; this._fn = parent.accumulator; this._hs = parent.hasSeed; this._s = parent.seed; this._ha = false; this._a = null; this._hv = false; this._i = 0; __super__.call(this); } ReduceObserver.prototype.next = function (x) { !this._hv && (this._hv = true); if (this._ha) { this._a = tryCatch(this._fn)(this._a, x, this._i, this._p); } else { this._a = this._hs ? tryCatch(this._fn)(this._s, x, this._i, this._p) : x; this._ha = true; } if (this._a === errorObj) { return this._o.onError(this._a.e); } this._i++; }; ReduceObserver.prototype.error = function (e) { this._o.onError(e); }; ReduceObserver.prototype.completed = function () { this._hv && this._o.onNext(this._a); !this._hv && this._hs && this._o.onNext(this._s); !this._hv && !this._hs && this._o.onError(new EmptyError()); this._o.onCompleted(); }; return ReduceObserver; }(AbstractObserver)); /** * Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value. * For aggregation behavior with incremental intermediate results, see Observable.scan. * @param {Function} accumulator An accumulator function to be invoked on each element. * @param {Any} [seed] The initial accumulator value. * @returns {Observable} An observable sequence containing a single element with the final accumulator value. */ observableProto.reduce = function () { var hasSeed = false, seed, accumulator = arguments[0]; if (arguments.length === 2) { hasSeed = true; seed = arguments[1]; } return new ReduceObservable(this, accumulator, hasSeed, seed); }; var SomeObservable = (function (__super__) { inherits(SomeObservable, __super__); function SomeObservable(source, fn) { this.source = source; this._fn = fn; __super__.call(this); } SomeObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new SomeObserver(o, this._fn, this.source)); }; return SomeObservable; }(ObservableBase)); var SomeObserver = (function (__super__) { inherits(SomeObserver, __super__); function SomeObserver(o, fn, s) { this._o = o; this._fn = fn; this._s = s; this._i = 0; __super__.call(this); } SomeObserver.prototype.next = function (x) { var result = tryCatch(this._fn)(x, this._i++, this._s); if (result === errorObj) { return this._o.onError(result.e); } if (Boolean(result)) { this._o.onNext(true); this._o.onCompleted(); } }; SomeObserver.prototype.error = function (e) { this._o.onError(e); }; SomeObserver.prototype.completed = function () { this._o.onNext(false); this._o.onCompleted(); }; return SomeObserver; }(AbstractObserver)); /** * Determines whether any element of an observable sequence satisfies a condition if present, else if any items are in the sequence. * @param {Function} [predicate] A function to test each element for a condition. * @returns {Observable} An observable sequence containing a single element determining whether any elements in the source sequence pass the test in the specified predicate if given, else if any items are in the sequence. */ observableProto.some = function (predicate, thisArg) { var fn = bindCallback(predicate, thisArg, 3); return new SomeObservable(this, fn); }; var IsEmptyObservable = (function (__super__) { inherits(IsEmptyObservable, __super__); function IsEmptyObservable(source) { this.source = source; __super__.call(this); } IsEmptyObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new IsEmptyObserver(o)); }; return IsEmptyObservable; }(ObservableBase)); var IsEmptyObserver = (function(__super__) { inherits(IsEmptyObserver, __super__); function IsEmptyObserver(o) { this._o = o; __super__.call(this); } IsEmptyObserver.prototype.next = function () { this._o.onNext(false); this._o.onCompleted(); }; IsEmptyObserver.prototype.error = function (e) { this._o.onError(e); }; IsEmptyObserver.prototype.completed = function () { this._o.onNext(true); this._o.onCompleted(); }; return IsEmptyObserver; }(AbstractObserver)); /** * Determines whether an observable sequence is empty. * @returns {Observable} An observable sequence containing a single element determining whether the source sequence is empty. */ observableProto.isEmpty = function () { return new IsEmptyObservable(this); }; var EveryObservable = (function (__super__) { inherits(EveryObservable, __super__); function EveryObservable(source, fn) { this.source = source; this._fn = fn; __super__.call(this); } EveryObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new EveryObserver(o, this._fn, this.source)); }; return EveryObservable; }(ObservableBase)); var EveryObserver = (function (__super__) { inherits(EveryObserver, __super__); function EveryObserver(o, fn, s) { this._o = o; this._fn = fn; this._s = s; this._i = 0; __super__.call(this); } EveryObserver.prototype.next = function (x) { var result = tryCatch(this._fn)(x, this._i++, this._s); if (result === errorObj) { return this._o.onError(result.e); } if (!Boolean(result)) { this._o.onNext(false); this._o.onCompleted(); } }; EveryObserver.prototype.error = function (e) { this._o.onError(e); }; EveryObserver.prototype.completed = function () { this._o.onNext(true); this._o.onCompleted(); }; return EveryObserver; }(AbstractObserver)); /** * Determines whether all elements of an observable sequence satisfy a condition. * @param {Function} [predicate] A function to test each element for a condition. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence containing a single element determining whether all elements in the source sequence pass the test in the specified predicate. */ observableProto.every = function (predicate, thisArg) { var fn = bindCallback(predicate, thisArg, 3); return new EveryObservable(this, fn); }; var IncludesObservable = (function (__super__) { inherits(IncludesObservable, __super__); function IncludesObservable(source, elem, idx) { var n = +idx || 0; Math.abs(n) === Infinity && (n = 0); this.source = source; this._elem = elem; this._n = n; __super__.call(this); } IncludesObservable.prototype.subscribeCore = function (o) { if (this._n < 0) { o.onNext(false); o.onCompleted(); return disposableEmpty; } return this.source.subscribe(new IncludesObserver(o, this._elem, this._n)); }; return IncludesObservable; }(ObservableBase)); var IncludesObserver = (function (__super__) { inherits(IncludesObserver, __super__); function IncludesObserver(o, elem, n) { this._o = o; this._elem = elem; this._n = n; this._i = 0; __super__.call(this); } function comparer(a, b) { return (a === 0 && b === 0) || (a === b || (isNaN(a) && isNaN(b))); } IncludesObserver.prototype.next = function (x) { if (this._i++ >= this._n && comparer(x, this._elem)) { this._o.onNext(true); this._o.onCompleted(); } }; IncludesObserver.prototype.error = function (e) { this._o.onError(e); }; IncludesObserver.prototype.completed = function () { this._o.onNext(false); this._o.onCompleted(); }; return IncludesObserver; }(AbstractObserver)); /** * Determines whether an observable sequence includes a specified element with an optional equality comparer. * @param searchElement The value to locate in the source sequence. * @param {Number} [fromIndex] An equality comparer to compare elements. * @returns {Observable} An observable sequence containing a single element determining whether the source sequence includes an element that has the specified value from the given index. */ observableProto.includes = function (searchElement, fromIndex) { return new IncludesObservable(this, searchElement, fromIndex); }; var CountObservable = (function (__super__) { inherits(CountObservable, __super__); function CountObservable(source, fn) { this.source = source; this._fn = fn; __super__.call(this); } CountObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new CountObserver(o, this._fn, this.source)); }; return CountObservable; }(ObservableBase)); var CountObserver = (function (__super__) { inherits(CountObserver, __super__); function CountObserver(o, fn, s) { this._o = o; this._fn = fn; this._s = s; this._i = 0; this._c = 0; __super__.call(this); } CountObserver.prototype.next = function (x) { if (this._fn) { var result = tryCatch(this._fn)(x, this._i++, this._s); if (result === errorObj) { return this._o.onError(result.e); } Boolean(result) && (this._c++); } else { this._c++; } }; CountObserver.prototype.error = function (e) { this._o.onError(e); }; CountObserver.prototype.completed = function () { this._o.onNext(this._c); this._o.onCompleted(); }; return CountObserver; }(AbstractObserver)); /** * Returns an observable sequence containing a value that represents how many elements in the specified observable sequence satisfy a condition if provided, else the count of items. * @example * res = source.count(); * res = source.count(function (x) { return x > 3; }); * @param {Function} [predicate]A function to test each element for a condition. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence containing a single element with a number that represents how many elements in the input sequence satisfy the condition in the predicate function if provided, else the count of items in the sequence. */ observableProto.count = function (predicate, thisArg) { var fn = bindCallback(predicate, thisArg, 3); return new CountObservable(this, fn); }; var IndexOfObservable = (function (__super__) { inherits(IndexOfObservable, __super__); function IndexOfObservable(source, e, n) { this.source = source; this._e = e; this._n = n; __super__.call(this); } IndexOfObservable.prototype.subscribeCore = function (o) { if (this._n < 0) { o.onNext(-1); o.onCompleted(); return disposableEmpty; } return this.source.subscribe(new IndexOfObserver(o, this._e, this._n)); }; return IndexOfObservable; }(ObservableBase)); var IndexOfObserver = (function (__super__) { inherits(IndexOfObserver, __super__); function IndexOfObserver(o, e, n) { this._o = o; this._e = e; this._n = n; this._i = 0; __super__.call(this); } IndexOfObserver.prototype.next = function (x) { if (this._i >= this._n && x === this._e) { this._o.onNext(this._i); this._o.onCompleted(); } this._i++; }; IndexOfObserver.prototype.error = function (e) { this._o.onError(e); }; IndexOfObserver.prototype.completed = function () { this._o.onNext(-1); this._o.onCompleted(); }; return IndexOfObserver; }(AbstractObserver)); /** * Returns the first index at which a given element can be found in the observable sequence, or -1 if it is not present. * @param {Any} searchElement Element to locate in the array. * @param {Number} [fromIndex] The index to start the search. If not specified, defaults to 0. * @returns {Observable} And observable sequence containing the first index at which a given element can be found in the observable sequence, or -1 if it is not present. */ observableProto.indexOf = function(searchElement, fromIndex) { var n = +fromIndex || 0; Math.abs(n) === Infinity && (n = 0); return new IndexOfObservable(this, searchElement, n); }; var SumObservable = (function (__super__) { inherits(SumObservable, __super__); function SumObservable(source, fn) { this.source = source; this._fn = fn; __super__.call(this); } SumObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new SumObserver(o, this._fn, this.source)); }; return SumObservable; }(ObservableBase)); var SumObserver = (function (__super__) { inherits(SumObserver, __super__); function SumObserver(o, fn, s) { this._o = o; this._fn = fn; this._s = s; this._i = 0; this._c = 0; __super__.call(this); } SumObserver.prototype.next = function (x) { if (this._fn) { var result = tryCatch(this._fn)(x, this._i++, this._s); if (result === errorObj) { return this._o.onError(result.e); } this._c += result; } else { this._c += x; } }; SumObserver.prototype.error = function (e) { this._o.onError(e); }; SumObserver.prototype.completed = function () { this._o.onNext(this._c); this._o.onCompleted(); }; return SumObserver; }(AbstractObserver)); /** * Computes the sum of a sequence of values that are obtained by invoking an optional transform function on each element of the input sequence, else if not specified computes the sum on each item in the sequence. * @param {Function} [selector] A transform function to apply to each element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence containing a single element with the sum of the values in the source sequence. */ observableProto.sum = function (keySelector, thisArg) { var fn = bindCallback(keySelector, thisArg, 3); return new SumObservable(this, fn); }; /** * Returns the elements in an observable sequence with the minimum key value according to the specified comparer. * @example * var res = source.minBy(function (x) { return x.value; }); * var res = source.minBy(function (x) { return x.value; }, function (x, y) { return x - y; }); * @param {Function} keySelector Key selector function. * @param {Function} [comparer] Comparer used to compare key values. * @returns {Observable} An observable sequence containing a list of zero or more elements that have a minimum key value. */ observableProto.minBy = function (keySelector, comparer) { comparer || (comparer = defaultSubComparer); return new ExtremaByObservable(this, keySelector, function (x, y) { return comparer(x, y) * -1; }); }; /** * Returns the minimum element in an observable sequence according to the optional comparer else a default greater than less than check. * @example * var res = source.min(); * var res = source.min(function (x, y) { return x.value - y.value; }); * @param {Function} [comparer] Comparer used to compare elements. * @returns {Observable} An observable sequence containing a single element with the minimum element in the source sequence. */ observableProto.min = function (comparer) { return this.minBy(identity, comparer).map(firstOnly); }; /** * Returns the elements in an observable sequence with the maximum key value according to the specified comparer. * @example * var res = source.maxBy(function (x) { return x.value; }); * var res = source.maxBy(function (x) { return x.value; }, function (x, y) { return x - y;; }); * @param {Function} keySelector Key selector function. * @param {Function} [comparer] Comparer used to compare key values. * @returns {Observable} An observable sequence containing a list of zero or more elements that have a maximum key value. */ observableProto.maxBy = function (keySelector, comparer) { comparer || (comparer = defaultSubComparer); return new ExtremaByObservable(this, keySelector, comparer); }; /** * Returns the maximum value in an observable sequence according to the specified comparer. * @example * var res = source.max(); * var res = source.max(function (x, y) { return x.value - y.value; }); * @param {Function} [comparer] Comparer used to compare elements. * @returns {Observable} An observable sequence containing a single element with the maximum element in the source sequence. */ observableProto.max = function (comparer) { return this.maxBy(identity, comparer).map(firstOnly); }; var AverageObservable = (function (__super__) { inherits(AverageObservable, __super__); function AverageObservable(source, fn) { this.source = source; this._fn = fn; __super__.call(this); } AverageObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new AverageObserver(o, this._fn, this.source)); }; return AverageObservable; }(ObservableBase)); var AverageObserver = (function(__super__) { inherits(AverageObserver, __super__); function AverageObserver(o, fn, s) { this._o = o; this._fn = fn; this._s = s; this._c = 0; this._t = 0; __super__.call(this); } AverageObserver.prototype.next = function (x) { if(this._fn) { var r = tryCatch(this._fn)(x, this._c++, this._s); if (r === errorObj) { return this._o.onError(r.e); } this._t += r; } else { this._c++; this._t += x; } }; AverageObserver.prototype.error = function (e) { this._o.onError(e); }; AverageObserver.prototype.completed = function () { if (this._c === 0) { return this._o.onError(new EmptyError()); } this._o.onNext(this._t / this._c); this._o.onCompleted(); }; return AverageObserver; }(AbstractObserver)); /** * Computes the average of an observable sequence of values that are in the sequence or obtained by invoking a transform function on each element of the input sequence if present. * @param {Function} [selector] A transform function to apply to each element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence containing a single element with the average of the sequence of values. */ observableProto.average = function (keySelector, thisArg) { var source = this, fn; if (isFunction(keySelector)) { fn = bindCallback(keySelector, thisArg, 3); } return new AverageObservable(source, fn); }; /** * Determines whether two sequences are equal by comparing the elements pairwise using a specified equality comparer. * * @example * var res = res = source.sequenceEqual([1,2,3]); * var res = res = source.sequenceEqual([{ value: 42 }], function (x, y) { return x.value === y.value; }); * 3 - res = source.sequenceEqual(Rx.Observable.returnValue(42)); * 4 - res = source.sequenceEqual(Rx.Observable.returnValue({ value: 42 }), function (x, y) { return x.value === y.value; }); * @param {Observable} second Second observable sequence or array to compare. * @param {Function} [comparer] Comparer used to compare elements of both sequences. * @returns {Observable} An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the specified equality comparer. */ observableProto.sequenceEqual = function (second, comparer) { var first = this; comparer || (comparer = defaultComparer); return new AnonymousObservable(function (o) { var donel = false, doner = false, ql = [], qr = []; var subscription1 = first.subscribe(function (x) { if (qr.length > 0) { var v = qr.shift(); var equal = tryCatch(comparer)(v, x); if (equal === errorObj) { return o.onError(equal.e); } if (!equal) { o.onNext(false); o.onCompleted(); } } else if (doner) { o.onNext(false); o.onCompleted(); } else { ql.push(x); } }, function(e) { o.onError(e); }, function () { donel = true; if (ql.length === 0) { if (qr.length > 0) { o.onNext(false); o.onCompleted(); } else if (doner) { o.onNext(true); o.onCompleted(); } } }); (isArrayLike(second) || isIterable(second)) && (second = observableFrom(second)); isPromise(second) && (second = observableFromPromise(second)); var subscription2 = second.subscribe(function (x) { if (ql.length > 0) { var v = ql.shift(); var equal = tryCatch(comparer)(v, x); if (equal === errorObj) { return o.onError(equal.e); } if (!equal) { o.onNext(false); o.onCompleted(); } } else if (donel) { o.onNext(false); o.onCompleted(); } else { qr.push(x); } }, function(e) { o.onError(e); }, function () { doner = true; if (qr.length === 0) { if (ql.length > 0) { o.onNext(false); o.onCompleted(); } else if (donel) { o.onNext(true); o.onCompleted(); } } }); return new BinaryDisposable(subscription1, subscription2); }, first); }; var ElementAtObservable = (function (__super__) { inherits(ElementAtObservable, __super__); function ElementAtObservable(source, i, d) { this.source = source; this._i = i; this._d = d; __super__.call(this); } ElementAtObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new ElementAtObserver(o, this._i, this._d)); }; return ElementAtObservable; }(ObservableBase)); var ElementAtObserver = (function (__super__) { inherits(ElementAtObserver, __super__); function ElementAtObserver(o, i, d) { this._o = o; this._i = i; this._d = d; __super__.call(this); } ElementAtObserver.prototype.next = function (x) { if (this._i-- === 0) { this._o.onNext(x); this._o.onCompleted(); } }; ElementAtObserver.prototype.error = function (e) { this._o.onError(e); }; ElementAtObserver.prototype.completed = function () { if (this._d === undefined) { this._o.onError(new ArgumentOutOfRangeError()); } else { this._o.onNext(this._d); this._o.onCompleted(); } }; return ElementAtObserver; }(AbstractObserver)); /** * Returns the element at a specified index in a sequence or default value if not found. * @param {Number} index The zero-based index of the element to retrieve. * @param {Any} [defaultValue] The default value to use if elementAt does not find a value. * @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence. */ observableProto.elementAt = function (index, defaultValue) { if (index < 0) { throw new ArgumentOutOfRangeError(); } return new ElementAtObservable(this, index, defaultValue); }; var SingleObserver = (function(__super__) { inherits(SingleObserver, __super__); function SingleObserver(o, obj, s) { this._o = o; this._obj = obj; this._s = s; this._i = 0; this._hv = false; this._v = null; __super__.call(this); } SingleObserver.prototype.next = function (x) { var shouldYield = false; if (this._obj.predicate) { var res = tryCatch(this._obj.predicate)(x, this._i++, this._s); if (res === errorObj) { return this._o.onError(res.e); } Boolean(res) && (shouldYield = true); } else if (!this._obj.predicate) { shouldYield = true; } if (shouldYield) { if (this._hv) { return this._o.onError(new Error('Sequence contains more than one matching element')); } this._hv = true; this._v = x; } }; SingleObserver.prototype.error = function (e) { this._o.onError(e); }; SingleObserver.prototype.completed = function () { if (this._hv) { this._o.onNext(this._v); this._o.onCompleted(); } else if (this._obj.defaultValue === undefined) { this._o.onError(new EmptyError()); } else { this._o.onNext(this._obj.defaultValue); this._o.onCompleted(); } }; return SingleObserver; }(AbstractObserver)); /** * Returns the only element of an observable sequence that satisfies the condition in the optional predicate, and reports an exception if there is not exactly one element in the observable sequence. * @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate. */ observableProto.single = function (predicate, thisArg) { var obj = {}, source = this; if (typeof arguments[0] === 'object') { obj = arguments[0]; } else { obj = { predicate: arguments[0], thisArg: arguments[1], defaultValue: arguments[2] }; } if (isFunction (obj.predicate)) { var fn = obj.predicate; obj.predicate = bindCallback(fn, obj.thisArg, 3); } return new AnonymousObservable(function (o) { return source.subscribe(new SingleObserver(o, obj, source)); }, source); }; var FirstObservable = (function (__super__) { inherits(FirstObservable, __super__); function FirstObservable(source, obj) { this.source = source; this._obj = obj; __super__.call(this); } FirstObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new FirstObserver(o, this._obj, this.source)); }; return FirstObservable; }(ObservableBase)); var FirstObserver = (function(__super__) { inherits(FirstObserver, __super__); function FirstObserver(o, obj, s) { this._o = o; this._obj = obj; this._s = s; this._i = 0; __super__.call(this); } FirstObserver.prototype.next = function (x) { if (this._obj.predicate) { var res = tryCatch(this._obj.predicate)(x, this._i++, this._s); if (res === errorObj) { return this._o.onError(res.e); } if (Boolean(res)) { this._o.onNext(x); this._o.onCompleted(); } } else if (!this._obj.predicate) { this._o.onNext(x); this._o.onCompleted(); } }; FirstObserver.prototype.error = function (e) { this._o.onError(e); }; FirstObserver.prototype.completed = function () { if (this._obj.defaultValue === undefined) { this._o.onError(new EmptyError()); } else { this._o.onNext(this._obj.defaultValue); this._o.onCompleted(); } }; return FirstObserver; }(AbstractObserver)); /** * Returns the first element of an observable sequence that satisfies the condition in the predicate if present else the first item in the sequence. * @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate if provided, else the first item in the sequence. */ observableProto.first = function () { var obj = {}, source = this; if (typeof arguments[0] === 'object') { obj = arguments[0]; } else { obj = { predicate: arguments[0], thisArg: arguments[1], defaultValue: arguments[2] }; } if (isFunction (obj.predicate)) { var fn = obj.predicate; obj.predicate = bindCallback(fn, obj.thisArg, 3); } return new FirstObservable(this, obj); }; var LastObservable = (function (__super__) { inherits(LastObservable, __super__); function LastObservable(source, obj) { this.source = source; this._obj = obj; __super__.call(this); } LastObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new LastObserver(o, this._obj, this.source)); }; return LastObservable; }(ObservableBase)); var LastObserver = (function(__super__) { inherits(LastObserver, __super__); function LastObserver(o, obj, s) { this._o = o; this._obj = obj; this._s = s; this._i = 0; this._hv = false; this._v = null; __super__.call(this); } LastObserver.prototype.next = function (x) { var shouldYield = false; if (this._obj.predicate) { var res = tryCatch(this._obj.predicate)(x, this._i++, this._s); if (res === errorObj) { return this._o.onError(res.e); } Boolean(res) && (shouldYield = true); } else if (!this._obj.predicate) { shouldYield = true; } if (shouldYield) { this._hv = true; this._v = x; } }; LastObserver.prototype.error = function (e) { this._o.onError(e); }; LastObserver.prototype.completed = function () { if (this._hv) { this._o.onNext(this._v); this._o.onCompleted(); } else if (this._obj.defaultValue === undefined) { this._o.onError(new EmptyError()); } else { this._o.onNext(this._obj.defaultValue); this._o.onCompleted(); } }; return LastObserver; }(AbstractObserver)); /** * Returns the last element of an observable sequence that satisfies the condition in the predicate if specified, else the last element. * @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate. */ observableProto.last = function () { var obj = {}, source = this; if (typeof arguments[0] === 'object') { obj = arguments[0]; } else { obj = { predicate: arguments[0], thisArg: arguments[1], defaultValue: arguments[2] }; } if (isFunction (obj.predicate)) { var fn = obj.predicate; obj.predicate = bindCallback(fn, obj.thisArg, 3); } return new LastObservable(this, obj); }; var FindValueObserver = (function(__super__) { inherits(FindValueObserver, __super__); function FindValueObserver(observer, source, callback, yieldIndex) { this._o = observer; this._s = source; this._cb = callback; this._y = yieldIndex; this._i = 0; __super__.call(this); } FindValueObserver.prototype.next = function (x) { var shouldRun = tryCatch(this._cb)(x, this._i, this._s); if (shouldRun === errorObj) { return this._o.onError(shouldRun.e); } if (shouldRun) { this._o.onNext(this._y ? this._i : x); this._o.onCompleted(); } else { this._i++; } }; FindValueObserver.prototype.error = function (e) { this._o.onError(e); }; FindValueObserver.prototype.completed = function () { this._y && this._o.onNext(-1); this._o.onCompleted(); }; return FindValueObserver; }(AbstractObserver)); function findValue (source, predicate, thisArg, yieldIndex) { var callback = bindCallback(predicate, thisArg, 3); return new AnonymousObservable(function (o) { return source.subscribe(new FindValueObserver(o, source, callback, yieldIndex)); }, source); } /** * Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire Observable sequence. * @param {Function} predicate The predicate that defines the conditions of the element to search for. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} An Observable sequence with the first element that matches the conditions defined by the specified predicate, if found; otherwise, undefined. */ observableProto.find = function (predicate, thisArg) { return findValue(this, predicate, thisArg, false); }; /** * Searches for an element that matches the conditions defined by the specified predicate, and returns * an Observable sequence with the zero-based index of the first occurrence within the entire Observable sequence. * @param {Function} predicate The predicate that defines the conditions of the element to search for. * @param {Any} [thisArg] Object to use as `this` when executing the predicate. * @returns {Observable} An Observable sequence with the zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. */ observableProto.findIndex = function (predicate, thisArg) { return findValue(this, predicate, thisArg, true); }; var ToSetObservable = (function (__super__) { inherits(ToSetObservable, __super__); function ToSetObservable(source) { this.source = source; __super__.call(this); } ToSetObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new ToSetObserver(o)); }; return ToSetObservable; }(ObservableBase)); var ToSetObserver = (function (__super__) { inherits(ToSetObserver, __super__); function ToSetObserver(o) { this._o = o; this._s = new root.Set(); __super__.call(this); } ToSetObserver.prototype.next = function (x) { this._s.add(x); }; ToSetObserver.prototype.error = function (e) { this._o.onError(e); }; ToSetObserver.prototype.completed = function () { this._o.onNext(this._s); this._o.onCompleted(); }; return ToSetObserver; }(AbstractObserver)); /** * Converts the observable sequence to a Set if it exists. * @returns {Observable} An observable sequence with a single value of a Set containing the values from the observable sequence. */ observableProto.toSet = function () { if (typeof root.Set === 'undefined') { throw new TypeError(); } return new ToSetObservable(this); }; var ToMapObservable = (function (__super__) { inherits(ToMapObservable, __super__); function ToMapObservable(source, k, e) { this.source = source; this._k = k; this._e = e; __super__.call(this); } ToMapObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new ToMapObserver(o, this._k, this._e)); }; return ToMapObservable; }(ObservableBase)); var ToMapObserver = (function (__super__) { inherits(ToMapObserver, __super__); function ToMapObserver(o, k, e) { this._o = o; this._k = k; this._e = e; this._m = new root.Map(); __super__.call(this); } ToMapObserver.prototype.next = function (x) { var key = tryCatch(this._k)(x); if (key === errorObj) { return this._o.onError(key.e); } var elem = x; if (this._e) { elem = tryCatch(this._e)(x); if (elem === errorObj) { return this._o.onError(elem.e); } } this._m.set(key, elem); }; ToMapObserver.prototype.error = function (e) { this._o.onError(e); }; ToMapObserver.prototype.completed = function () { this._o.onNext(this._m); this._o.onCompleted(); }; return ToMapObserver; }(AbstractObserver)); /** * Converts the observable sequence to a Map if it exists. * @param {Function} keySelector A function which produces the key for the Map. * @param {Function} [elementSelector] An optional function which produces the element for the Map. If not present, defaults to the value from the observable sequence. * @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence. */ observableProto.toMap = function (keySelector, elementSelector) { if (typeof root.Map === 'undefined') { throw new TypeError(); } return new ToMapObservable(this, keySelector, elementSelector); }; var SliceObservable = (function (__super__) { inherits(SliceObservable, __super__); function SliceObservable(source, b, e) { this.source = source; this._b = b; this._e = e; __super__.call(this); } SliceObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new SliceObserver(o, this._b, this._e)); }; return SliceObservable; }(ObservableBase)); var SliceObserver = (function (__super__) { inherits(SliceObserver, __super__); function SliceObserver(o, b, e) { this._o = o; this._b = b; this._e = e; this._i = 0; __super__.call(this); } SliceObserver.prototype.next = function (x) { if (this._i >= this._b) { if (this._e === this._i) { this._o.onCompleted(); } else { this._o.onNext(x); } } this._i++; }; SliceObserver.prototype.error = function (e) { this._o.onError(e); }; SliceObserver.prototype.completed = function () { this._o.onCompleted(); }; return SliceObserver; }(AbstractObserver)); /* * The slice() method returns a shallow copy of a portion of an Observable into a new Observable object. * Unlike the array version, this does not support negative numbers for being or end. * @param {Number} [begin] Zero-based index at which to begin extraction. If omitted, this will default to zero. * @param {Number} [end] Zero-based index at which to end extraction. slice extracts up to but not including end. * If omitted, this will emit the rest of the Observable object. * @returns {Observable} A shallow copy of a portion of an Observable into a new Observable object. */ observableProto.slice = function (begin, end) { var start = begin || 0; if (start < 0) { throw new Rx.ArgumentOutOfRangeError(); } if (typeof end === 'number' && end < start) { throw new Rx.ArgumentOutOfRangeError(); } return new SliceObservable(this, start, end); }; var LastIndexOfObservable = (function (__super__) { inherits(LastIndexOfObservable, __super__); function LastIndexOfObservable(source, e, n) { this.source = source; this._e = e; this._n = n; __super__.call(this); } LastIndexOfObservable.prototype.subscribeCore = function (o) { if (this._n < 0) { o.onNext(-1); o.onCompleted(); return disposableEmpty; } return this.source.subscribe(new LastIndexOfObserver(o, this._e, this._n)); }; return LastIndexOfObservable; }(ObservableBase)); var LastIndexOfObserver = (function (__super__) { inherits(LastIndexOfObserver, __super__); function LastIndexOfObserver(o, e, n) { this._o = o; this._e = e; this._n = n; this._v = 0; this._hv = false; this._i = 0; __super__.call(this); } LastIndexOfObserver.prototype.next = function (x) { if (this._i >= this._n && x === this._e) { this._hv = true; this._v = this._i; } this._i++; }; LastIndexOfObserver.prototype.error = function (e) { this._o.onError(e); }; LastIndexOfObserver.prototype.completed = function () { if (this._hv) { this._o.onNext(this._v); } else { this._o.onNext(-1); } this._o.onCompleted(); }; return LastIndexOfObserver; }(AbstractObserver)); /** * Returns the last index at which a given element can be found in the observable sequence, or -1 if it is not present. * @param {Any} searchElement Element to locate in the array. * @param {Number} [fromIndex] The index to start the search. If not specified, defaults to 0. * @returns {Observable} And observable sequence containing the last index at which a given element can be found in the observable sequence, or -1 if it is not present. */ observableProto.lastIndexOf = function(searchElement, fromIndex) { var n = +fromIndex || 0; Math.abs(n) === Infinity && (n = 0); return new LastIndexOfObservable(this, searchElement, n); }; return Rx; })); ================================================ FILE: dist/rx.all.compat.js ================================================ // Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. ;(function (undefined) { var objectTypes = { 'function': true, 'object': true }; function checkGlobal(value) { return (value && value.Object === Object) ? value : null; } var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); var freeSelf = checkGlobal(objectTypes[typeof self] && self); var freeWindow = checkGlobal(objectTypes[typeof window] && window); var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; var thisGlobal = checkGlobal(objectTypes[typeof this] && this); var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); var Rx = { internals: {}, config: { Promise: root.Promise }, helpers: { } }; // Defaults var noop = Rx.helpers.noop = function () { }, identity = Rx.helpers.identity = function (x) { return x; }, defaultNow = Rx.helpers.defaultNow = (function () { return !!Date.now ? Date.now : function () { return +new Date; }; }()), defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); }, defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); }, defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); }, defaultError = Rx.helpers.defaultError = function (err) { throw err; }, isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.subscribe !== 'function' && typeof p.then === 'function'; }, isFunction = Rx.helpers.isFunction = (function () { var isFn = function (value) { return typeof value == 'function' || false; }; // fallback for older versions of Chrome and Safari if (isFn(/x/)) { isFn = function(value) { return typeof value == 'function' && toString.call(value) == '[object Function]'; }; } return isFn; }()); function cloneArray(arr) { var len = arr.length, a = new Array(len); for(var i = 0; i < len; i++) { a[i] = arr[i]; } return a; } var errorObj = {e: {}}; function tryCatcherGen(tryCatchTarget) { return function tryCatcher() { try { return tryCatchTarget.apply(this, arguments); } catch (e) { errorObj.e = e; return errorObj; } }; } var tryCatch = Rx.internals.tryCatch = function tryCatch(fn) { if (!isFunction(fn)) { throw new TypeError('fn must be a function'); } return tryCatcherGen(fn); }; function thrower(e) { throw e; } Rx.config.longStackSupport = false; var hasStacks = false, stacks = tryCatch(function () { throw new Error(); })(); hasStacks = !!stacks.e && !!stacks.e.stack; // All code after this point will be filtered from stack traces reported by RxJS var rStartingLine = captureLine(), rFileName; var STACK_JUMP_SEPARATOR = 'From previous event:'; function makeStackTraceLong(error, observable) { // If possible, transform the error stack trace by removing Node and RxJS // cruft, then concatenating with the stack trace of `observable`. if (hasStacks && observable.stack && typeof error === 'object' && error !== null && error.stack && error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1 ) { var stacks = []; for (var o = observable; !!o; o = o.source) { if (o.stack) { stacks.unshift(o.stack); } } stacks.unshift(error.stack); var concatedStacks = stacks.join('\n' + STACK_JUMP_SEPARATOR + '\n'); error.stack = filterStackString(concatedStacks); } } function filterStackString(stackString) { var lines = stackString.split('\n'), desiredLines = []; for (var i = 0, len = lines.length; i < len; i++) { var line = lines[i]; if (!isInternalFrame(line) && !isNodeFrame(line) && line) { desiredLines.push(line); } } return desiredLines.join('\n'); } function isInternalFrame(stackLine) { var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine); if (!fileNameAndLineNumber) { return false; } var fileName = fileNameAndLineNumber[0], lineNumber = fileNameAndLineNumber[1]; return fileName === rFileName && lineNumber >= rStartingLine && lineNumber <= rEndingLine; } function isNodeFrame(stackLine) { return stackLine.indexOf('(module.js:') !== -1 || stackLine.indexOf('(node.js:') !== -1; } function captureLine() { if (!hasStacks) { return; } try { throw new Error(); } catch (e) { var lines = e.stack.split('\n'); var firstLine = lines[0].indexOf('@') > 0 ? lines[1] : lines[2]; var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine); if (!fileNameAndLineNumber) { return; } rFileName = fileNameAndLineNumber[0]; return fileNameAndLineNumber[1]; } } function getFileNameAndLineNumber(stackLine) { // Named functions: 'at functionName (filename:lineNumber:columnNumber)' var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine); if (attempt1) { return [attempt1[1], Number(attempt1[2])]; } // Anonymous functions: 'at filename:lineNumber:columnNumber' var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine); if (attempt2) { return [attempt2[1], Number(attempt2[2])]; } // Firefox style: 'function@filename:lineNumber or @filename:lineNumber' var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine); if (attempt3) { return [attempt3[1], Number(attempt3[2])]; } } // Utilities var toString = Object.prototype.toString; var arrayClass = '[object Array]', funcClass = '[object Function]', stringClass = '[object String]'; if (!Array.prototype.forEach) { Array.prototype.forEach = function (callback, thisArg) { var T, k; if (this == null) { throw new TypeError(' this is null or not defined'); } var O = Object(this); var len = O.length >>> 0; if (typeof callback !== 'function') { throw new TypeError(callback + ' is not a function'); } if (arguments.length > 1) { T = thisArg; } k = 0; while (k < len) { var kValue; if (k in O) { kValue = O[k]; callback.call(T, kValue, k, O); } k++; } }; } var boxedString = Object('a'), splitString = boxedString[0] !== 'a' || !(0 in boxedString); if (!Array.prototype.every) { Array.prototype.every = function every(fun /*, thisp */) { var object = Object(this), self = splitString && toString.call(this) === stringClass ? this.split('') : object, length = self.length >>> 0, thisp = arguments[1]; if (toString.call(fun) !== funcClass) { throw new TypeError(fun + ' is not a function'); } for (var i = 0; i < length; i++) { if (i in self && !fun.call(thisp, self[i], i, object)) { return false; } } return true; }; } if (!Array.prototype.map) { Array.prototype.map = function map(fun /*, thisp*/) { var object = Object(this), self = splitString && toString.call(this) === stringClass ? this.split('') : object, length = self.length >>> 0, result = new Array(length), thisp = arguments[1]; if (toString.call(fun) !== funcClass) { throw new TypeError(fun + ' is not a function'); } for (var i = 0; i < length; i++) { if (i in self) { result[i] = fun.call(thisp, self[i], i, object); } } return result; }; } if (!Array.prototype.filter) { Array.prototype.filter = function (predicate) { var results = [], item, t = new Object(this); for (var i = 0, len = t.length >>> 0; i < len; i++) { item = t[i]; if (i in t && predicate.call(arguments[1], item, i, t)) { results.push(item); } } return results; }; } if (!Array.isArray) { Array.isArray = function (arg) { return toString.call(arg) === arrayClass; }; } if (!Array.prototype.indexOf) { Array.prototype.indexOf = function indexOf(searchElement) { var t = Object(this); var len = t.length >>> 0; if (len === 0) { return -1; } var n = 0; if (arguments.length > 1) { n = Number(arguments[1]); if (n !== n) { n = 0; } else if (n !== 0 && n !== Infinity && n !== -Infinity) { n = (n > 0 || -1) * Math.floor(Math.abs(n)); } } if (n >= len) { return -1; } var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); for (; k < len; k++) { if (k in t && t[k] === searchElement) { return k; } } return -1; }; } // Fix for Tessel if (!Object.prototype.propertyIsEnumerable) { Object.prototype.propertyIsEnumerable = function (key) { for (var k in this) { if (k === key) { return true; } } return false; }; } if (!Object.keys) { Object.keys = (function() { 'use strict'; var hasOwnProperty = Object.prototype.hasOwnProperty, hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'); return function(obj) { if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { throw new TypeError('Object.keys called on non-object'); } var result = [], prop, i; for (prop in obj) { if (hasOwnProperty.call(obj, prop)) { result.push(prop); } } if (hasDontEnumBug) { for (i = 0; i < dontEnumsLength; i++) { if (hasOwnProperty.call(obj, dontEnums[i])) { result.push(dontEnums[i]); } } } return result; }; }()); } if (typeof Object.create !== 'function') { // Production steps of ECMA-262, Edition 5, 15.2.3.5 // Reference: http://es5.github.io/#x15.2.3.5 Object.create = (function() { function Temp() {} var hasOwn = Object.prototype.hasOwnProperty; return function (O) { if (typeof O !== 'object') { throw new TypeError('Object prototype may only be an Object or null'); } Temp.prototype = O; var obj = new Temp(); Temp.prototype = null; if (arguments.length > 1) { // Object.defineProperties does ToObject on its first argument. var Properties = Object(arguments[1]); for (var prop in Properties) { if (hasOwn.call(Properties, prop)) { obj[prop] = Properties[prop]; } } } // 5. Return obj return obj; }; })(); } root.Element && root.Element.prototype.attachEvent && !root.Element.prototype.addEventListener && (function () { function addMethod(name, fn) { Window.prototype[name] = HTMLDocument.prototype[name] = Element.prototype[name] = fn; } addMethod('addEventListener', function (type, listener) { var target = this; var listeners = target._c1_listeners = target._c1_listeners || {}; var typeListeners = listeners[type] = listeners[type] || []; target.attachEvent('on' + type, typeListeners.event = function (e) { e || (e = root.event); var documentElement = target.document && target.document.documentElement || target.documentElement || { scrollLeft: 0, scrollTop: 0 }; e.currentTarget = target; e.pageX = e.clientX + documentElement.scrollLeft; e.pageY = e.clientY + documentElement.scrollTop; e.preventDefault = function () { e.bubbledKeyCode = e.keyCode; if (e.ctrlKey) { try { e.keyCode = 0; } catch (e) { } } e.defaultPrevented = true; e.returnValue = false; e.modified = true; e.returnValue = false; }; e.stopImmediatePropagation = function () { immediatePropagation = false; e.cancelBubble = true; }; e.stopPropagation = function () { e.cancelBubble = true; }; e.relatedTarget = e.fromElement || null; e.target = e.srcElement || target; e.timeStamp = +new Date(); // Normalize key events switch(e.type) { case 'keypress': var c = ('charCode' in e ? e.charCode : e.keyCode); if (c === 10) { c = 0; e.keyCode = 13; } else if (c === 13 || c === 27) { c = 0; } else if (c === 3) { c = 99; } e.charCode = c; e.keyChar = e.charCode ? String.fromCharCode(e.charCode) : ''; break; } var copiedEvent = {}; for (var prop in e) { copiedEvent[prop] = e[prop]; } for (var i = 0, typeListenersCache = [].concat(typeListeners), typeListenerCache, immediatePropagation = true; immediatePropagation && (typeListenerCache = typeListenersCache[i]); ++i) { for (var ii = 0, typeListener; typeListener = typeListeners[ii]; ++ii) { if (typeListener === typeListenerCache) { typeListener.call(target, copiedEvent); break; } } } }); typeListeners.push(listener); }); addMethod('removeEventListener', function (type, listener) { var target = this; var listeners = target._c1_listeners = target._c1_listeners || {}; var typeListeners = listeners[type] = listeners[type] || []; for (var i = typeListeners.length - 1, typeListener; typeListener = typeListeners[i]; --i) { if (typeListener === listener) { typeListeners.splice(i, 1); break; } } !typeListeners.length && typeListeners.event && target.detachEvent('on' + type, typeListeners.event); }); addMethod('dispatchEvent', function (e) { var target = this; var type = e.type; var listeners = target._c1_listeners = target._c1_listeners || {}; var typeListeners = listeners[type] = listeners[type] || []; try { return target.fireEvent('on' + type, e); } catch (err) { return typeListeners.event && typeListeners.event(e); } }); function ready() { if (ready.interval && document.body) { ready.interval = clearInterval(ready.interval); document.dispatchEvent(new CustomEvent('DOMContentLoaded')); } } ready.interval = setInterval(ready, 1); root.addEventListener('load', ready); }()); (!root.CustomEvent || typeof root.CustomEvent === 'object') && (function() { function CustomEvent (type, params) { var event; params = params || { bubbles: false, cancelable: false, detail: undefined }; try { if (document.createEvent) { event = document.createEvent('CustomEvent'); event.initCustomEvent(type, params.bubbles, params.cancelable, params.detail); } else if (document.createEventObject) { event = document.createEventObject(); } } catch (error) { event = document.createEvent('Event'); event.initEvent(type, params.bubbles, params.cancelable); event.detail = params.detail; } return event; } root.CustomEvent && (CustomEvent.prototype = root.CustomEvent.prototype); root.CustomEvent = CustomEvent; }()); var EmptyError = Rx.EmptyError = function() { this.message = 'Sequence contains no elements.'; Error.call(this); }; EmptyError.prototype = Object.create(Error.prototype); EmptyError.prototype.name = 'EmptyError'; var ObjectDisposedError = Rx.ObjectDisposedError = function() { this.message = 'Object has been disposed'; Error.call(this); }; ObjectDisposedError.prototype = Object.create(Error.prototype); ObjectDisposedError.prototype.name = 'ObjectDisposedError'; var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () { this.message = 'Argument out of range'; Error.call(this); }; ArgumentOutOfRangeError.prototype = Object.create(Error.prototype); ArgumentOutOfRangeError.prototype.name = 'ArgumentOutOfRangeError'; var NotSupportedError = Rx.NotSupportedError = function (message) { this.message = message || 'This operation is not supported'; Error.call(this); }; NotSupportedError.prototype = Object.create(Error.prototype); NotSupportedError.prototype.name = 'NotSupportedError'; var NotImplementedError = Rx.NotImplementedError = function (message) { this.message = message || 'This operation is not implemented'; Error.call(this); }; NotImplementedError.prototype = Object.create(Error.prototype); NotImplementedError.prototype.name = 'NotImplementedError'; var notImplemented = Rx.helpers.notImplemented = function () { throw new NotImplementedError(); }; var notSupported = Rx.helpers.notSupported = function () { throw new NotSupportedError(); }; // Shim in iterator support var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) || '_es6shim_iterator_'; // Bug for mozilla version if (root.Set && typeof new root.Set()['@@iterator'] === 'function') { $iterator$ = '@@iterator'; } var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined }; var isIterable = Rx.helpers.isIterable = function (o) { return o && o[$iterator$] !== undefined; }; var isArrayLike = Rx.helpers.isArrayLike = function (o) { return o && o.length !== undefined; }; Rx.helpers.iterator = $iterator$; var bindCallback = Rx.internals.bindCallback = function (func, thisArg, argCount) { if (typeof thisArg === 'undefined') { return func; } switch(argCount) { case 0: return function() { return func.call(thisArg) }; case 1: return function(arg) { return func.call(thisArg, arg); }; case 2: return function(value, index) { return func.call(thisArg, value, index); }; case 3: return function(value, index, collection) { return func.call(thisArg, value, index, collection); }; } return function() { return func.apply(thisArg, arguments); }; }; /** Used to determine if values are of the language type Object */ var dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'], dontEnumsLength = dontEnums.length; var argsTag = '[object Arguments]', arrayTag = '[object Array]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', funcTag = '[object Function]', mapTag = '[object Map]', numberTag = '[object Number]', objectTag = '[object Object]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; var objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty, objToString = objectProto.toString, MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; var keys = Object.keys || (function() { var hasOwnProperty = Object.prototype.hasOwnProperty, hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'), dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ], dontEnumsLength = dontEnums.length; return function(obj) { if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { throw new TypeError('Object.keys called on non-object'); } var result = [], prop, i; for (prop in obj) { if (hasOwnProperty.call(obj, prop)) { result.push(prop); } } if (hasDontEnumBug) { for (i = 0; i < dontEnumsLength; i++) { if (hasOwnProperty.call(obj, dontEnums[i])) { result.push(dontEnums[i]); } } } return result; }; }()); function equalObjects(object, other, equalFunc, isLoose, stackA, stackB) { var objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length; if (objLength !== othLength && !isLoose) { return false; } var index = objLength, key; while (index--) { key = objProps[index]; if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) { return false; } } var skipCtor = isLoose; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key], result; if (!(result === undefined ? equalFunc(objValue, othValue, isLoose, stackA, stackB) : result)) { return false; } skipCtor || (skipCtor = key === 'constructor'); } if (!skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; if (objCtor !== othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor === 'function' && objCtor instanceof objCtor && typeof othCtor === 'function' && othCtor instanceof othCtor)) { return false; } } return true; } function equalByTag(object, other, tag) { switch (tag) { case boolTag: case dateTag: return +object === +other; case errorTag: return object.name === other.name && object.message === other.message; case numberTag: return (object !== +object) ? other !== +other : object === +other; case regexpTag: case stringTag: return object === (other + ''); } return false; } var isObject = Rx.internals.isObject = function(value) { var type = typeof value; return !!value && (type === 'object' || type === 'function'); }; function isObjectLike(value) { return !!value && typeof value === 'object'; } function isLength(value) { return typeof value === 'number' && value > -1 && value % 1 === 0 && value <= MAX_SAFE_INTEGER; } var isHostObject = (function() { try { Object({ 'toString': 0 } + ''); } catch(e) { return function() { return false; }; } return function(value) { return typeof value.toString !== 'function' && typeof (value + '') === 'string'; }; }()); function isTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; } var isArray = Array.isArray || function(value) { return isObjectLike(value) && isLength(value.length) && objToString.call(value) === arrayTag; }; function arraySome (array, predicate) { var index = -1, length = array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } function equalArrays(array, other, equalFunc, isLoose, stackA, stackB) { var index = -1, arrLength = array.length, othLength = other.length; if (arrLength !== othLength && !(isLoose && othLength > arrLength)) { return false; } // Ignore non-index properties. while (++index < arrLength) { var arrValue = array[index], othValue = other[index], result; if (result !== undefined) { if (result) { continue; } return false; } // Recursively compare arrays (susceptible to call stack limits). if (isLoose) { if (!arraySome(other, function(othValue) { return arrValue === othValue || equalFunc(arrValue, othValue, isLoose, stackA, stackB); })) { return false; } } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, isLoose, stackA, stackB))) { return false; } } return true; } function baseIsEqualDeep(object, other, equalFunc, isLoose, stackA, stackB) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = arrayTag, othTag = arrayTag; if (!objIsArr) { objTag = objToString.call(object); if (objTag === argsTag) { objTag = objectTag; } else if (objTag !== objectTag) { objIsArr = isTypedArray(object); } } if (!othIsArr) { othTag = objToString.call(other); if (othTag === argsTag) { othTag = objectTag; } } var objIsObj = objTag === objectTag && !isHostObject(object), othIsObj = othTag === objectTag && !isHostObject(other), isSameTag = objTag === othTag; if (isSameTag && !(objIsArr || objIsObj)) { return equalByTag(object, other, objTag); } if (!isLoose) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, isLoose, stackA, stackB); } } if (!isSameTag) { return false; } // Assume cyclic values are equal. // For more information on detecting circular references see https://es5.github.io/#JO. stackA || (stackA = []); stackB || (stackB = []); var length = stackA.length; while (length--) { if (stackA[length] === object) { return stackB[length] === other; } } // Add `object` and `other` to the stack of traversed objects. stackA.push(object); stackB.push(other); var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, isLoose, stackA, stackB); stackA.pop(); stackB.pop(); return result; } function baseIsEqual(value, other, isLoose, stackA, stackB) { if (value === other) { return true; } if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, baseIsEqual, isLoose, stackA, stackB); } var isEqual = Rx.internals.isEqual = function (value, other) { return baseIsEqual(value, other); }; var hasProp = {}.hasOwnProperty, slice = Array.prototype.slice; var inherits = Rx.internals.inherits = function (child, parent) { function __() { this.constructor = child; } __.prototype = parent.prototype; child.prototype = new __(); }; var addProperties = Rx.internals.addProperties = function (obj) { for(var sources = [], i = 1, len = arguments.length; i < len; i++) { sources.push(arguments[i]); } for (var idx = 0, ln = sources.length; idx < ln; idx++) { var source = sources[idx]; for (var prop in source) { obj[prop] = source[prop]; } } }; // Rx Utils var addRef = Rx.internals.addRef = function (xs, r) { return new AnonymousObservable(function (observer) { return new BinaryDisposable(r.getDisposable(), xs.subscribe(observer)); }); }; function arrayInitialize(count, factory) { var a = new Array(count); for (var i = 0; i < count; i++) { a[i] = factory(); } return a; } function IndexedItem(id, value) { this.id = id; this.value = value; } IndexedItem.prototype.compareTo = function (other) { var c = this.value.compareTo(other.value); c === 0 && (c = this.id - other.id); return c; }; var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) { this.items = new Array(capacity); this.length = 0; }; var priorityProto = PriorityQueue.prototype; priorityProto.isHigherPriority = function (left, right) { return this.items[left].compareTo(this.items[right]) < 0; }; priorityProto.percolate = function (index) { if (index >= this.length || index < 0) { return; } var parent = index - 1 >> 1; if (parent < 0 || parent === index) { return; } if (this.isHigherPriority(index, parent)) { var temp = this.items[index]; this.items[index] = this.items[parent]; this.items[parent] = temp; this.percolate(parent); } }; priorityProto.heapify = function (index) { +index || (index = 0); if (index >= this.length || index < 0) { return; } var left = 2 * index + 1, right = 2 * index + 2, first = index; if (left < this.length && this.isHigherPriority(left, first)) { first = left; } if (right < this.length && this.isHigherPriority(right, first)) { first = right; } if (first !== index) { var temp = this.items[index]; this.items[index] = this.items[first]; this.items[first] = temp; this.heapify(first); } }; priorityProto.peek = function () { return this.items[0].value; }; priorityProto.removeAt = function (index) { this.items[index] = this.items[--this.length]; this.items[this.length] = undefined; this.heapify(); }; priorityProto.dequeue = function () { var result = this.peek(); this.removeAt(0); return result; }; priorityProto.enqueue = function (item) { var index = this.length++; this.items[index] = new IndexedItem(PriorityQueue.count++, item); this.percolate(index); }; priorityProto.remove = function (item) { for (var i = 0; i < this.length; i++) { if (this.items[i].value === item) { this.removeAt(i); return true; } } return false; }; PriorityQueue.count = 0; /** * Represents a group of disposable resources that are disposed together. * @constructor */ var CompositeDisposable = Rx.CompositeDisposable = function () { var args = [], i, len; if (Array.isArray(arguments[0])) { args = arguments[0]; } else { len = arguments.length; args = new Array(len); for(i = 0; i < len; i++) { args[i] = arguments[i]; } } this.disposables = args; this.isDisposed = false; this.length = args.length; }; var CompositeDisposablePrototype = CompositeDisposable.prototype; /** * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. * @param {Mixed} item Disposable to add. */ CompositeDisposablePrototype.add = function (item) { if (this.isDisposed) { item.dispose(); } else { this.disposables.push(item); this.length++; } }; /** * Removes and disposes the first occurrence of a disposable from the CompositeDisposable. * @param {Mixed} item Disposable to remove. * @returns {Boolean} true if found; false otherwise. */ CompositeDisposablePrototype.remove = function (item) { var shouldDispose = false; if (!this.isDisposed) { var idx = this.disposables.indexOf(item); if (idx !== -1) { shouldDispose = true; this.disposables.splice(idx, 1); this.length--; item.dispose(); } } return shouldDispose; }; /** * Disposes all disposables in the group and removes them from the group. */ CompositeDisposablePrototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var len = this.disposables.length, currentDisposables = new Array(len); for(var i = 0; i < len; i++) { currentDisposables[i] = this.disposables[i]; } this.disposables = []; this.length = 0; for (i = 0; i < len; i++) { currentDisposables[i].dispose(); } } }; /** * Provides a set of static methods for creating Disposables. * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. */ var Disposable = Rx.Disposable = function (action) { this.isDisposed = false; this.action = action || noop; }; /** Performs the task of cleaning up resources. */ Disposable.prototype.dispose = function () { if (!this.isDisposed) { this.action(); this.isDisposed = true; } }; /** * Creates a disposable object that invokes the specified action when disposed. * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. * @return {Disposable} The disposable object that runs the given action upon disposal. */ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); }; /** * Gets the disposable that does nothing when disposed. */ var disposableEmpty = Disposable.empty = { dispose: noop }; /** * Validates whether the given object is a disposable * @param {Object} Object to test whether it has a dispose method * @returns {Boolean} true if a disposable object, else false. */ var isDisposable = Disposable.isDisposable = function (d) { return d && isFunction(d.dispose); }; var checkDisposed = Disposable.checkDisposed = function (disposable) { if (disposable.isDisposed) { throw new ObjectDisposedError(); } }; var disposableFixup = Disposable._fixup = function (result) { return isDisposable(result) ? result : disposableEmpty; }; // Single assignment var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () { this.isDisposed = false; this.current = null; }; SingleAssignmentDisposable.prototype.getDisposable = function () { return this.current; }; SingleAssignmentDisposable.prototype.setDisposable = function (value) { if (this.current) { throw new Error('Disposable has already been assigned'); } var shouldDispose = this.isDisposed; !shouldDispose && (this.current = value); shouldDispose && value && value.dispose(); }; SingleAssignmentDisposable.prototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var old = this.current; this.current = null; old && old.dispose(); } }; // Multiple assignment disposable var SerialDisposable = Rx.SerialDisposable = function () { this.isDisposed = false; this.current = null; }; SerialDisposable.prototype.getDisposable = function () { return this.current; }; SerialDisposable.prototype.setDisposable = function (value) { var shouldDispose = this.isDisposed; if (!shouldDispose) { var old = this.current; this.current = value; } old && old.dispose(); shouldDispose && value && value.dispose(); }; SerialDisposable.prototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var old = this.current; this.current = null; } old && old.dispose(); }; var BinaryDisposable = Rx.BinaryDisposable = function (first, second) { this._first = first; this._second = second; this.isDisposed = false; }; BinaryDisposable.prototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var old1 = this._first; this._first = null; old1 && old1.dispose(); var old2 = this._second; this._second = null; old2 && old2.dispose(); } }; var NAryDisposable = Rx.NAryDisposable = function (disposables) { this._disposables = disposables; this.isDisposed = false; }; NAryDisposable.prototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; for (var i = 0, len = this._disposables.length; i < len; i++) { this._disposables[i].dispose(); } this._disposables.length = 0; } }; /** * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed. */ var RefCountDisposable = Rx.RefCountDisposable = (function () { function InnerDisposable(disposable) { this.disposable = disposable; this.disposable.count++; this.isInnerDisposed = false; } InnerDisposable.prototype.dispose = function () { if (!this.disposable.isDisposed && !this.isInnerDisposed) { this.isInnerDisposed = true; this.disposable.count--; if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) { this.disposable.isDisposed = true; this.disposable.underlyingDisposable.dispose(); } } }; /** * Initializes a new instance of the RefCountDisposable with the specified disposable. * @constructor * @param {Disposable} disposable Underlying disposable. */ function RefCountDisposable(disposable) { this.underlyingDisposable = disposable; this.isDisposed = false; this.isPrimaryDisposed = false; this.count = 0; } /** * Disposes the underlying disposable only when all dependent disposables have been disposed */ RefCountDisposable.prototype.dispose = function () { if (!this.isDisposed && !this.isPrimaryDisposed) { this.isPrimaryDisposed = true; if (this.count === 0) { this.isDisposed = true; this.underlyingDisposable.dispose(); } } }; /** * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable. * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime. */ RefCountDisposable.prototype.getDisposable = function () { return this.isDisposed ? disposableEmpty : new InnerDisposable(this); }; return RefCountDisposable; })(); function ScheduledDisposable(scheduler, disposable) { this.scheduler = scheduler; this.disposable = disposable; this.isDisposed = false; } function scheduleItem(s, self) { if (!self.isDisposed) { self.isDisposed = true; self.disposable.dispose(); } } ScheduledDisposable.prototype.dispose = function () { this.scheduler.schedule(this, scheduleItem); }; var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) { this.scheduler = scheduler; this.state = state; this.action = action; this.dueTime = dueTime; this.comparer = comparer || defaultSubComparer; this.disposable = new SingleAssignmentDisposable(); }; ScheduledItem.prototype.invoke = function () { this.disposable.setDisposable(this.invokeCore()); }; ScheduledItem.prototype.compareTo = function (other) { return this.comparer(this.dueTime, other.dueTime); }; ScheduledItem.prototype.isCancelled = function () { return this.disposable.isDisposed; }; ScheduledItem.prototype.invokeCore = function () { return disposableFixup(this.action(this.scheduler, this.state)); }; /** Provides a set of static properties to access commonly used schedulers. */ var Scheduler = Rx.Scheduler = (function () { function Scheduler() { } /** Determines whether the given object is a scheduler */ Scheduler.isScheduler = function (s) { return s instanceof Scheduler; }; var schedulerProto = Scheduler.prototype; /** * Schedules an action to be executed. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.schedule = function (state, action) { throw new NotImplementedError(); }; /** * Schedules an action to be executed after dueTime. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleFuture = function (state, dueTime, action) { var dt = dueTime; dt instanceof Date && (dt = dt - this.now()); dt = Scheduler.normalize(dt); if (dt === 0) { return this.schedule(state, action); } return this._scheduleFuture(state, dt, action); }; schedulerProto._scheduleFuture = function (state, dueTime, action) { throw new NotImplementedError(); }; /** Gets the current time according to the local machine's system clock. */ Scheduler.now = defaultNow; /** Gets the current time according to the local machine's system clock. */ Scheduler.prototype.now = defaultNow; /** * Normalizes the specified TimeSpan value to a positive value. * @param {Number} timeSpan The time span value to normalize. * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0 */ Scheduler.normalize = function (timeSpan) { timeSpan < 0 && (timeSpan = 0); return timeSpan; }; return Scheduler; }()); var normalizeTime = Scheduler.normalize, isScheduler = Scheduler.isScheduler; (function (schedulerProto) { function invokeRecImmediate(scheduler, pair) { var state = pair[0], action = pair[1], group = new CompositeDisposable(); action(state, innerAction); return group; function innerAction(state2) { var isAdded = false, isDone = false; var d = scheduler.schedule(state2, scheduleWork); if (!isDone) { group.add(d); isAdded = true; } function scheduleWork(_, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } action(state3, innerAction); return disposableEmpty; } } } function invokeRecDate(scheduler, pair) { var state = pair[0], action = pair[1], group = new CompositeDisposable(); action(state, innerAction); return group; function innerAction(state2, dueTime1) { var isAdded = false, isDone = false; var d = scheduler.scheduleFuture(state2, dueTime1, scheduleWork); if (!isDone) { group.add(d); isAdded = true; } function scheduleWork(_, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } action(state3, innerAction); return disposableEmpty; } } } /** * Schedules an action to be executed recursively. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursive = function (state, action) { return this.schedule([state, action], invokeRecImmediate); }; /** * Schedules an action to be executed recursively after a specified relative or absolute due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number | Date} dueTime Relative or absolute time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveFuture = function (state, dueTime, action) { return this.scheduleFuture([state, action], dueTime, invokeRecDate); }; }(Scheduler.prototype)); (function (schedulerProto) { /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Mixed} state Initial state passed to the action upon the first iteration. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed, potentially updating the state. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ schedulerProto.schedulePeriodic = function(state, period, action) { if (typeof root.setInterval === 'undefined') { throw new NotSupportedError(); } period = normalizeTime(period); var s = state, id = root.setInterval(function () { s = action(s); }, period); return disposableCreate(function () { root.clearInterval(id); }); }; }(Scheduler.prototype)); (function (schedulerProto) { /** * Returns a scheduler that wraps the original scheduler, adding exception handling for scheduled actions. * @param {Function} handler Handler that's run if an exception is caught. The exception will be rethrown if the handler returns false. * @returns {Scheduler} Wrapper around the original scheduler, enforcing exception handling. */ schedulerProto.catchError = schedulerProto['catch'] = function (handler) { return new CatchScheduler(this, handler); }; }(Scheduler.prototype)); var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () { function createTick(self) { return function tick(command, recurse) { recurse(0, self._period); var state = tryCatch(self._action)(self._state); if (state === errorObj) { self._cancel.dispose(); thrower(state.e); } self._state = state; }; } function SchedulePeriodicRecursive(scheduler, state, period, action) { this._scheduler = scheduler; this._state = state; this._period = period; this._action = action; } SchedulePeriodicRecursive.prototype.start = function () { var d = new SingleAssignmentDisposable(); this._cancel = d; d.setDisposable(this._scheduler.scheduleRecursiveFuture(0, this._period, createTick(this))); return d; }; return SchedulePeriodicRecursive; }()); /** Gets a scheduler that schedules work immediately on the current thread. */ var ImmediateScheduler = (function (__super__) { inherits(ImmediateScheduler, __super__); function ImmediateScheduler() { __super__.call(this); } ImmediateScheduler.prototype.schedule = function (state, action) { return disposableFixup(action(this, state)); }; return ImmediateScheduler; }(Scheduler)); var immediateScheduler = Scheduler.immediate = new ImmediateScheduler(); /** * Gets a scheduler that schedules work as soon as possible on the current thread. */ var CurrentThreadScheduler = (function (__super__) { var queue; function runTrampoline () { while (queue.length > 0) { var item = queue.dequeue(); !item.isCancelled() && item.invoke(); } } inherits(CurrentThreadScheduler, __super__); function CurrentThreadScheduler() { __super__.call(this); } CurrentThreadScheduler.prototype.schedule = function (state, action) { var si = new ScheduledItem(this, state, action, this.now()); if (!queue) { queue = new PriorityQueue(4); queue.enqueue(si); var result = tryCatch(runTrampoline)(); queue = null; if (result === errorObj) { thrower(result.e); } } else { queue.enqueue(si); } return si.disposable; }; CurrentThreadScheduler.prototype.scheduleRequired = function () { return !queue; }; return CurrentThreadScheduler; }(Scheduler)); var currentThreadScheduler = Scheduler.currentThread = new CurrentThreadScheduler(); var scheduleMethod, clearMethod; var localTimer = (function () { var localSetTimeout, localClearTimeout = noop; if (!!root.setTimeout) { localSetTimeout = root.setTimeout; localClearTimeout = root.clearTimeout; } else if (!!root.WScript) { localSetTimeout = function (fn, time) { root.WScript.Sleep(time); fn(); }; } else { throw new NotSupportedError(); } return { setTimeout: localSetTimeout, clearTimeout: localClearTimeout }; }()); var localSetTimeout = localTimer.setTimeout, localClearTimeout = localTimer.clearTimeout; (function () { var nextHandle = 1, tasksByHandle = {}, currentlyRunning = false; clearMethod = function (handle) { delete tasksByHandle[handle]; }; function runTask(handle) { if (currentlyRunning) { localSetTimeout(function () { runTask(handle); }, 0); } else { var task = tasksByHandle[handle]; if (task) { currentlyRunning = true; var result = tryCatch(task)(); clearMethod(handle); currentlyRunning = false; if (result === errorObj) { thrower(result.e); } } } } var reNative = new RegExp('^' + String(toString) .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') .replace(/toString| for [^\]]+/g, '.*?') + '$' ); var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' && !reNative.test(setImmediate) && setImmediate; function postMessageSupported () { // Ensure not in a worker if (!root.postMessage || root.importScripts) { return false; } var isAsync = false, oldHandler = root.onmessage; // Test for async root.onmessage = function () { isAsync = true; }; root.postMessage('', '*'); root.onmessage = oldHandler; return isAsync; } // Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout if (isFunction(setImmediate)) { scheduleMethod = function (action) { var id = nextHandle++; tasksByHandle[id] = action; setImmediate(function () { runTask(id); }); return id; }; } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') { scheduleMethod = function (action) { var id = nextHandle++; tasksByHandle[id] = action; process.nextTick(function () { runTask(id); }); return id; }; } else if (postMessageSupported()) { var MSG_PREFIX = 'ms.rx.schedule' + Math.random(); var onGlobalPostMessage = function (event) { // Only if we're a match to avoid any other global events if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) { runTask(event.data.substring(MSG_PREFIX.length)); } }; root.addEventListener('message', onGlobalPostMessage, false); scheduleMethod = function (action) { var id = nextHandle++; tasksByHandle[id] = action; root.postMessage(MSG_PREFIX + id, '*'); return id; }; } else if (!!root.MessageChannel) { var channel = new root.MessageChannel(); channel.port1.onmessage = function (e) { runTask(e.data); }; scheduleMethod = function (action) { var id = nextHandle++; tasksByHandle[id] = action; channel.port2.postMessage(id); return id; }; } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) { scheduleMethod = function (action) { var scriptElement = root.document.createElement('script'); var id = nextHandle++; tasksByHandle[id] = action; scriptElement.onreadystatechange = function () { runTask(id); scriptElement.onreadystatechange = null; scriptElement.parentNode.removeChild(scriptElement); scriptElement = null; }; root.document.documentElement.appendChild(scriptElement); return id; }; } else { scheduleMethod = function (action) { var id = nextHandle++; tasksByHandle[id] = action; localSetTimeout(function () { runTask(id); }, 0); return id; }; } }()); /** * Gets a scheduler that schedules work via a timed callback based upon platform. */ var DefaultScheduler = (function (__super__) { inherits(DefaultScheduler, __super__); function DefaultScheduler() { __super__.call(this); } function scheduleAction(disposable, action, scheduler, state) { return function schedule() { disposable.setDisposable(Disposable._fixup(action(scheduler, state))); }; } function ClearDisposable(id) { this._id = id; this.isDisposed = false; } ClearDisposable.prototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; clearMethod(this._id); } }; function LocalClearDisposable(id) { this._id = id; this.isDisposed = false; } LocalClearDisposable.prototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; localClearTimeout(this._id); } }; DefaultScheduler.prototype.schedule = function (state, action) { var disposable = new SingleAssignmentDisposable(), id = scheduleMethod(scheduleAction(disposable, action, this, state)); return new BinaryDisposable(disposable, new ClearDisposable(id)); }; DefaultScheduler.prototype._scheduleFuture = function (state, dueTime, action) { if (dueTime === 0) { return this.schedule(state, action); } var disposable = new SingleAssignmentDisposable(), id = localSetTimeout(scheduleAction(disposable, action, this, state), dueTime); return new BinaryDisposable(disposable, new LocalClearDisposable(id)); }; function scheduleLongRunning(state, action, disposable) { return function () { action(state, disposable); }; } DefaultScheduler.prototype.scheduleLongRunning = function (state, action) { var disposable = disposableCreate(noop); scheduleMethod(scheduleLongRunning(state, action, disposable)); return disposable; }; return DefaultScheduler; }(Scheduler)); var defaultScheduler = Scheduler['default'] = Scheduler.async = new DefaultScheduler(); var CatchScheduler = (function (__super__) { inherits(CatchScheduler, __super__); function CatchScheduler(scheduler, handler) { this._scheduler = scheduler; this._handler = handler; this._recursiveOriginal = null; this._recursiveWrapper = null; __super__.call(this); } CatchScheduler.prototype.schedule = function (state, action) { return this._scheduler.schedule(state, this._wrap(action)); }; CatchScheduler.prototype._scheduleFuture = function (state, dueTime, action) { return this._scheduler.schedule(state, dueTime, this._wrap(action)); }; CatchScheduler.prototype.now = function () { return this._scheduler.now(); }; CatchScheduler.prototype._clone = function (scheduler) { return new CatchScheduler(scheduler, this._handler); }; CatchScheduler.prototype._wrap = function (action) { var parent = this; return function (self, state) { var res = tryCatch(action)(parent._getRecursiveWrapper(self), state); if (res === errorObj) { if (!parent._handler(res.e)) { thrower(res.e); } return disposableEmpty; } return disposableFixup(res); }; }; CatchScheduler.prototype._getRecursiveWrapper = function (scheduler) { if (this._recursiveOriginal !== scheduler) { this._recursiveOriginal = scheduler; var wrapper = this._clone(scheduler); wrapper._recursiveOriginal = scheduler; wrapper._recursiveWrapper = wrapper; this._recursiveWrapper = wrapper; } return this._recursiveWrapper; }; CatchScheduler.prototype.schedulePeriodic = function (state, period, action) { var self = this, failed = false, d = new SingleAssignmentDisposable(); d.setDisposable(this._scheduler.schedulePeriodic(state, period, function (state1) { if (failed) { return null; } var res = tryCatch(action)(state1); if (res === errorObj) { failed = true; if (!self._handler(res.e)) { thrower(res.e); } d.dispose(); return null; } return res; })); return d; }; return CatchScheduler; }(Scheduler)); /** * Represents a notification to an observer. */ var Notification = Rx.Notification = (function () { function Notification() { } Notification.prototype._accept = function (onNext, onError, onCompleted) { throw new NotImplementedError(); }; Notification.prototype._acceptObserver = function (onNext, onError, onCompleted) { throw new NotImplementedError(); }; /** * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result. * @param {Function | Observer} observerOrOnNext Function to invoke for an OnNext notification or Observer to invoke the notification on.. * @param {Function} onError Function to invoke for an OnError notification. * @param {Function} onCompleted Function to invoke for an OnCompleted notification. * @returns {Any} Result produced by the observation. */ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) { return observerOrOnNext && typeof observerOrOnNext === 'object' ? this._acceptObserver(observerOrOnNext) : this._accept(observerOrOnNext, onError, onCompleted); }; /** * Returns an observable sequence with a single notification. * * @memberOf Notifications * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on. * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription. */ Notification.prototype.toObservable = function (scheduler) { var self = this; isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (o) { return scheduler.schedule(self, function (_, notification) { notification._acceptObserver(o); notification.kind === 'N' && o.onCompleted(); }); }); }; return Notification; })(); var OnNextNotification = (function (__super__) { inherits(OnNextNotification, __super__); function OnNextNotification(value) { this.value = value; this.kind = 'N'; } OnNextNotification.prototype._accept = function (onNext) { return onNext(this.value); }; OnNextNotification.prototype._acceptObserver = function (o) { return o.onNext(this.value); }; OnNextNotification.prototype.toString = function () { return 'OnNext(' + this.value + ')'; }; return OnNextNotification; }(Notification)); var OnErrorNotification = (function (__super__) { inherits(OnErrorNotification, __super__); function OnErrorNotification(error) { this.error = error; this.kind = 'E'; } OnErrorNotification.prototype._accept = function (onNext, onError) { return onError(this.error); }; OnErrorNotification.prototype._acceptObserver = function (o) { return o.onError(this.error); }; OnErrorNotification.prototype.toString = function () { return 'OnError(' + this.error + ')'; }; return OnErrorNotification; }(Notification)); var OnCompletedNotification = (function (__super__) { inherits(OnCompletedNotification, __super__); function OnCompletedNotification() { this.kind = 'C'; } OnCompletedNotification.prototype._accept = function (onNext, onError, onCompleted) { return onCompleted(); }; OnCompletedNotification.prototype._acceptObserver = function (o) { return o.onCompleted(); }; OnCompletedNotification.prototype.toString = function () { return 'OnCompleted()'; }; return OnCompletedNotification; }(Notification)); /** * Creates an object that represents an OnNext notification to an observer. * @param {Any} value The value contained in the notification. * @returns {Notification} The OnNext notification containing the value. */ var notificationCreateOnNext = Notification.createOnNext = function (value) { return new OnNextNotification(value); }; /** * Creates an object that represents an OnError notification to an observer. * @param {Any} error The exception contained in the notification. * @returns {Notification} The OnError notification containing the exception. */ var notificationCreateOnError = Notification.createOnError = function (error) { return new OnErrorNotification(error); }; /** * Creates an object that represents an OnCompleted notification to an observer. * @returns {Notification} The OnCompleted notification. */ var notificationCreateOnCompleted = Notification.createOnCompleted = function () { return new OnCompletedNotification(); }; /** * Supports push-style iteration over an observable sequence. */ var Observer = Rx.Observer = function () { }; /** * Creates a notification callback from an observer. * @returns The action that forwards its input notification to the underlying observer. */ Observer.prototype.toNotifier = function () { var observer = this; return function (n) { return n.accept(observer); }; }; /** * Hides the identity of an observer. * @returns An observer that hides the identity of the specified observer. */ Observer.prototype.asObserver = function () { var self = this; return new AnonymousObserver( function (x) { self.onNext(x); }, function (err) { self.onError(err); }, function () { self.onCompleted(); }); }; /** * Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods. * If a violation is detected, an Error is thrown from the offending observer method call. * @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer. */ Observer.prototype.checked = function () { return new CheckedObserver(this); }; /** * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions. * @param {Function} [onNext] Observer's OnNext action implementation. * @param {Function} [onError] Observer's OnError action implementation. * @param {Function} [onCompleted] Observer's OnCompleted action implementation. * @returns {Observer} The observer object implemented using the given actions. */ var observerCreate = Observer.create = function (onNext, onError, onCompleted) { onNext || (onNext = noop); onError || (onError = defaultError); onCompleted || (onCompleted = noop); return new AnonymousObserver(onNext, onError, onCompleted); }; /** * Creates an observer from a notification callback. * @param {Function} handler Action that handles a notification. * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives. */ Observer.fromNotifier = function (handler, thisArg) { var cb = bindCallback(handler, thisArg, 1); return new AnonymousObserver(function (x) { return cb(notificationCreateOnNext(x)); }, function (e) { return cb(notificationCreateOnError(e)); }, function () { return cb(notificationCreateOnCompleted()); }); }; /** * Schedules the invocation of observer methods on the given scheduler. * @param {Scheduler} scheduler Scheduler to schedule observer messages on. * @returns {Observer} Observer whose messages are scheduled on the given scheduler. */ Observer.prototype.notifyOn = function (scheduler) { return new ObserveOnObserver(scheduler, this); }; Observer.prototype.makeSafe = function(disposable) { return new AnonymousSafeObserver(this._onNext, this._onError, this._onCompleted, disposable); }; /** * Abstract base class for implementations of the Observer class. * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages. */ var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) { inherits(AbstractObserver, __super__); /** * Creates a new observer in a non-stopped state. */ function AbstractObserver() { this.isStopped = false; } // Must be implemented by other observers AbstractObserver.prototype.next = notImplemented; AbstractObserver.prototype.error = notImplemented; AbstractObserver.prototype.completed = notImplemented; /** * Notifies the observer of a new element in the sequence. * @param {Any} value Next element in the sequence. */ AbstractObserver.prototype.onNext = function (value) { !this.isStopped && this.next(value); }; /** * Notifies the observer that an exception has occurred. * @param {Any} error The error that has occurred. */ AbstractObserver.prototype.onError = function (error) { if (!this.isStopped) { this.isStopped = true; this.error(error); } }; /** * Notifies the observer of the end of the sequence. */ AbstractObserver.prototype.onCompleted = function () { if (!this.isStopped) { this.isStopped = true; this.completed(); } }; /** * Disposes the observer, causing it to transition to the stopped state. */ AbstractObserver.prototype.dispose = function () { this.isStopped = true; }; AbstractObserver.prototype.fail = function (e) { if (!this.isStopped) { this.isStopped = true; this.error(e); return true; } return false; }; return AbstractObserver; }(Observer)); /** * Class to create an Observer instance from delegate-based implementations of the on* methods. */ var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) { inherits(AnonymousObserver, __super__); /** * Creates an observer from the specified OnNext, OnError, and OnCompleted actions. * @param {Any} onNext Observer's OnNext action implementation. * @param {Any} onError Observer's OnError action implementation. * @param {Any} onCompleted Observer's OnCompleted action implementation. */ function AnonymousObserver(onNext, onError, onCompleted) { __super__.call(this); this._onNext = onNext; this._onError = onError; this._onCompleted = onCompleted; } /** * Calls the onNext action. * @param {Any} value Next element in the sequence. */ AnonymousObserver.prototype.next = function (value) { this._onNext(value); }; /** * Calls the onError action. * @param {Any} error The error that has occurred. */ AnonymousObserver.prototype.error = function (error) { this._onError(error); }; /** * Calls the onCompleted action. */ AnonymousObserver.prototype.completed = function () { this._onCompleted(); }; return AnonymousObserver; }(AbstractObserver)); var CheckedObserver = (function (__super__) { inherits(CheckedObserver, __super__); function CheckedObserver(observer) { __super__.call(this); this._observer = observer; this._state = 0; // 0 - idle, 1 - busy, 2 - done } var CheckedObserverPrototype = CheckedObserver.prototype; CheckedObserverPrototype.onNext = function (value) { this.checkAccess(); var res = tryCatch(this._observer.onNext).call(this._observer, value); this._state = 0; res === errorObj && thrower(res.e); }; CheckedObserverPrototype.onError = function (err) { this.checkAccess(); var res = tryCatch(this._observer.onError).call(this._observer, err); this._state = 2; res === errorObj && thrower(res.e); }; CheckedObserverPrototype.onCompleted = function () { this.checkAccess(); var res = tryCatch(this._observer.onCompleted).call(this._observer); this._state = 2; res === errorObj && thrower(res.e); }; CheckedObserverPrototype.checkAccess = function () { if (this._state === 1) { throw new Error('Re-entrancy detected'); } if (this._state === 2) { throw new Error('Observer completed'); } if (this._state === 0) { this._state = 1; } }; return CheckedObserver; }(Observer)); var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) { inherits(ScheduledObserver, __super__); function ScheduledObserver(scheduler, observer) { __super__.call(this); this.scheduler = scheduler; this.observer = observer; this.isAcquired = false; this.hasFaulted = false; this.queue = []; this.disposable = new SerialDisposable(); } function enqueueNext(observer, x) { return function () { observer.onNext(x); }; } function enqueueError(observer, e) { return function () { observer.onError(e); }; } function enqueueCompleted(observer) { return function () { observer.onCompleted(); }; } ScheduledObserver.prototype.next = function (x) { this.queue.push(enqueueNext(this.observer, x)); }; ScheduledObserver.prototype.error = function (e) { this.queue.push(enqueueError(this.observer, e)); }; ScheduledObserver.prototype.completed = function () { this.queue.push(enqueueCompleted(this.observer)); }; function scheduleMethod(state, recurse) { var work; if (state.queue.length > 0) { work = state.queue.shift(); } else { state.isAcquired = false; return; } var res = tryCatch(work)(); if (res === errorObj) { state.queue = []; state.hasFaulted = true; return thrower(res.e); } recurse(state); } ScheduledObserver.prototype.ensureActive = function () { var isOwner = false; if (!this.hasFaulted && this.queue.length > 0) { isOwner = !this.isAcquired; this.isAcquired = true; } isOwner && this.disposable.setDisposable(this.scheduler.scheduleRecursive(this, scheduleMethod)); }; ScheduledObserver.prototype.dispose = function () { __super__.prototype.dispose.call(this); this.disposable.dispose(); }; return ScheduledObserver; }(AbstractObserver)); var ObserveOnObserver = (function (__super__) { inherits(ObserveOnObserver, __super__); function ObserveOnObserver(scheduler, observer, cancel) { __super__.call(this, scheduler, observer); this._cancel = cancel; } ObserveOnObserver.prototype.next = function (value) { __super__.prototype.next.call(this, value); this.ensureActive(); }; ObserveOnObserver.prototype.error = function (e) { __super__.prototype.error.call(this, e); this.ensureActive(); }; ObserveOnObserver.prototype.completed = function () { __super__.prototype.completed.call(this); this.ensureActive(); }; ObserveOnObserver.prototype.dispose = function () { __super__.prototype.dispose.call(this); this._cancel && this._cancel.dispose(); this._cancel = null; }; return ObserveOnObserver; })(ScheduledObserver); var observableProto; /** * Represents a push-style collection. */ var Observable = Rx.Observable = (function () { function makeSubscribe(self, subscribe) { return function (o) { var oldOnError = o.onError; o.onError = function (e) { makeStackTraceLong(e, self); oldOnError.call(o, e); }; return subscribe.call(self, o); }; } function Observable() { if (Rx.config.longStackSupport && hasStacks) { var oldSubscribe = this._subscribe; var e = tryCatch(thrower)(new Error()).e; this.stack = e.stack.substring(e.stack.indexOf('\n') + 1); this._subscribe = makeSubscribe(this, oldSubscribe); } } observableProto = Observable.prototype; /** * Determines whether the given object is an Observable * @param {Any} An object to determine whether it is an Observable * @returns {Boolean} true if an Observable, else false. */ Observable.isObservable = function (o) { return o && isFunction(o.subscribe); }; /** * Subscribes an o to the observable sequence. * @param {Mixed} [oOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribe = observableProto.forEach = function (oOrOnNext, onError, onCompleted) { return this._subscribe(typeof oOrOnNext === 'object' ? oOrOnNext : observerCreate(oOrOnNext, onError, onCompleted)); }; /** * Subscribes to the next value in the sequence with an optional "this" argument. * @param {Function} onNext The function to invoke on each element in the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnNext = function (onNext, thisArg) { return this._subscribe(observerCreate(typeof thisArg !== 'undefined' ? function(x) { onNext.call(thisArg, x); } : onNext)); }; /** * Subscribes to an exceptional condition in the sequence with an optional "this" argument. * @param {Function} onError The function to invoke upon exceptional termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnError = function (onError, thisArg) { return this._subscribe(observerCreate(null, typeof thisArg !== 'undefined' ? function(e) { onError.call(thisArg, e); } : onError)); }; /** * Subscribes to the next value in the sequence with an optional "this" argument. * @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnCompleted = function (onCompleted, thisArg) { return this._subscribe(observerCreate(null, null, typeof thisArg !== 'undefined' ? function() { onCompleted.call(thisArg); } : onCompleted)); }; return Observable; })(); var ObservableBase = Rx.ObservableBase = (function (__super__) { inherits(ObservableBase, __super__); function fixSubscriber(subscriber) { return subscriber && isFunction(subscriber.dispose) ? subscriber : isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty; } function setDisposable(s, state) { var ado = state[0], self = state[1]; var sub = tryCatch(self.subscribeCore).call(self, ado); if (sub === errorObj && !ado.fail(errorObj.e)) { thrower(errorObj.e); } ado.setDisposable(fixSubscriber(sub)); } function ObservableBase() { __super__.call(this); } ObservableBase.prototype._subscribe = function (o) { var ado = new AutoDetachObserver(o), state = [ado, this]; if (currentThreadScheduler.scheduleRequired()) { currentThreadScheduler.schedule(state, setDisposable); } else { setDisposable(null, state); } return ado; }; ObservableBase.prototype.subscribeCore = notImplemented; return ObservableBase; }(Observable)); var FlatMapObservable = Rx.FlatMapObservable = (function(__super__) { inherits(FlatMapObservable, __super__); function FlatMapObservable(source, selector, resultSelector, thisArg) { this.resultSelector = isFunction(resultSelector) ? resultSelector : null; this.selector = bindCallback(isFunction(selector) ? selector : function() { return selector; }, thisArg, 3); this.source = source; __super__.call(this); } FlatMapObservable.prototype.subscribeCore = function(o) { return this.source.subscribe(new InnerObserver(o, this.selector, this.resultSelector, this)); }; inherits(InnerObserver, AbstractObserver); function InnerObserver(observer, selector, resultSelector, source) { this.i = 0; this.selector = selector; this.resultSelector = resultSelector; this.source = source; this.o = observer; AbstractObserver.call(this); } InnerObserver.prototype._wrapResult = function(result, x, i) { return this.resultSelector ? result.map(function(y, i2) { return this.resultSelector(x, y, i, i2); }, this) : result; }; InnerObserver.prototype.next = function(x) { var i = this.i++; var result = tryCatch(this.selector)(x, i, this.source); if (result === errorObj) { return this.o.onError(result.e); } isPromise(result) && (result = observableFromPromise(result)); (isArrayLike(result) || isIterable(result)) && (result = Observable.from(result)); this.o.onNext(this._wrapResult(result, x, i)); }; InnerObserver.prototype.error = function(e) { this.o.onError(e); }; InnerObserver.prototype.completed = function() { this.o.onCompleted(); }; return FlatMapObservable; }(ObservableBase)); var Enumerable = Rx.internals.Enumerable = function () { }; function IsDisposedDisposable(state) { this._s = state; this.isDisposed = false; } IsDisposedDisposable.prototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; this._s.isDisposed = true; } }; var ConcatEnumerableObservable = (function(__super__) { inherits(ConcatEnumerableObservable, __super__); function ConcatEnumerableObservable(sources) { this.sources = sources; __super__.call(this); } function scheduleMethod(state, recurse) { if (state.isDisposed) { return; } var currentItem = tryCatch(state.e.next).call(state.e); if (currentItem === errorObj) { return state.o.onError(currentItem.e); } if (currentItem.done) { return state.o.onCompleted(); } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); state.subscription.setDisposable(d); d.setDisposable(currentValue.subscribe(new InnerObserver(state, recurse))); } ConcatEnumerableObservable.prototype.subscribeCore = function (o) { var subscription = new SerialDisposable(); var state = { isDisposed: false, o: o, subscription: subscription, e: this.sources[$iterator$]() }; var cancelable = currentThreadScheduler.scheduleRecursive(state, scheduleMethod); return new NAryDisposable([subscription, cancelable, new IsDisposedDisposable(state)]); }; function InnerObserver(state, recurse) { this._state = state; this._recurse = recurse; AbstractObserver.call(this); } inherits(InnerObserver, AbstractObserver); InnerObserver.prototype.next = function (x) { this._state.o.onNext(x); }; InnerObserver.prototype.error = function (e) { this._state.o.onError(e); }; InnerObserver.prototype.completed = function () { this._recurse(this._state); }; return ConcatEnumerableObservable; }(ObservableBase)); Enumerable.prototype.concat = function () { return new ConcatEnumerableObservable(this); }; var CatchErrorObservable = (function(__super__) { function CatchErrorObservable(sources) { this.sources = sources; __super__.call(this); } inherits(CatchErrorObservable, __super__); function scheduleMethod(state, recurse) { if (state.isDisposed) { return; } var currentItem = tryCatch(state.e.next).call(state.e); if (currentItem === errorObj) { return state.o.onError(currentItem.e); } if (currentItem.done) { return state.lastError !== null ? state.o.onError(state.lastError) : state.o.onCompleted(); } var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); state.subscription.setDisposable(d); d.setDisposable(currentValue.subscribe(new InnerObserver(state, recurse))); } CatchErrorObservable.prototype.subscribeCore = function (o) { var subscription = new SerialDisposable(); var state = { isDisposed: false, e: this.sources[$iterator$](), subscription: subscription, lastError: null, o: o }; var cancelable = currentThreadScheduler.scheduleRecursive(state, scheduleMethod); return new NAryDisposable([subscription, cancelable, new IsDisposedDisposable(state)]); }; function InnerObserver(state, recurse) { this._state = state; this._recurse = recurse; AbstractObserver.call(this); } inherits(InnerObserver, AbstractObserver); InnerObserver.prototype.next = function (x) { this._state.o.onNext(x); }; InnerObserver.prototype.error = function (e) { this._state.lastError = e; this._recurse(this._state); }; InnerObserver.prototype.completed = function () { this._state.o.onCompleted(); }; return CatchErrorObservable; }(ObservableBase)); Enumerable.prototype.catchError = function () { return new CatchErrorObservable(this); }; var RepeatEnumerable = (function (__super__) { inherits(RepeatEnumerable, __super__); function RepeatEnumerable(v, c) { this.v = v; this.c = c == null ? -1 : c; } RepeatEnumerable.prototype[$iterator$] = function () { return new RepeatEnumerator(this); }; function RepeatEnumerator(p) { this.v = p.v; this.l = p.c; } RepeatEnumerator.prototype.next = function () { if (this.l === 0) { return doneEnumerator; } if (this.l > 0) { this.l--; } return { done: false, value: this.v }; }; return RepeatEnumerable; }(Enumerable)); var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) { return new RepeatEnumerable(value, repeatCount); }; var OfEnumerable = (function(__super__) { inherits(OfEnumerable, __super__); function OfEnumerable(s, fn, thisArg) { this.s = s; this.fn = fn ? bindCallback(fn, thisArg, 3) : null; } OfEnumerable.prototype[$iterator$] = function () { return new OfEnumerator(this); }; function OfEnumerator(p) { this.i = -1; this.s = p.s; this.l = this.s.length; this.fn = p.fn; } OfEnumerator.prototype.next = function () { return ++this.i < this.l ? { done: false, value: !this.fn ? this.s[this.i] : this.fn(this.s[this.i], this.i, this.s) } : doneEnumerator; }; return OfEnumerable; }(Enumerable)); var enumerableOf = Enumerable.of = function (source, selector, thisArg) { return new OfEnumerable(source, selector, thisArg); }; var ObserveOnObservable = (function (__super__) { inherits(ObserveOnObservable, __super__); function ObserveOnObservable(source, s) { this.source = source; this._s = s; __super__.call(this); } ObserveOnObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new ObserveOnObserver(this._s, o)); }; return ObserveOnObservable; }(ObservableBase)); /** * Wraps the source sequence in order to run its observer callbacks on the specified scheduler. * * This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects * that require to be run on a scheduler, use subscribeOn. * * @param {Scheduler} scheduler Scheduler to notify observers on. * @returns {Observable} The source sequence whose observations happen on the specified scheduler. */ observableProto.observeOn = function (scheduler) { return new ObserveOnObservable(this, scheduler); }; var SubscribeOnObservable = (function (__super__) { inherits(SubscribeOnObservable, __super__); function SubscribeOnObservable(source, s) { this.source = source; this._s = s; __super__.call(this); } function scheduleMethod(scheduler, state) { var source = state[0], d = state[1], o = state[2]; d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(o))); } SubscribeOnObservable.prototype.subscribeCore = function (o) { var m = new SingleAssignmentDisposable(), d = new SerialDisposable(); d.setDisposable(m); m.setDisposable(this._s.schedule([this.source, d, o], scheduleMethod)); return d; }; return SubscribeOnObservable; }(ObservableBase)); /** * Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used; * see the remarks section for more information on the distinction between subscribeOn and observeOn. * This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer * callbacks on a scheduler, use observeOn. * @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on. * @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. */ observableProto.subscribeOn = function (scheduler) { return new SubscribeOnObservable(this, scheduler); }; var FromPromiseObservable = (function(__super__) { inherits(FromPromiseObservable, __super__); function FromPromiseObservable(p, s) { this._p = p; this._s = s; __super__.call(this); } function scheduleNext(s, state) { var o = state[0], data = state[1]; o.onNext(data); o.onCompleted(); } function scheduleError(s, state) { var o = state[0], err = state[1]; o.onError(err); } FromPromiseObservable.prototype.subscribeCore = function(o) { var sad = new SingleAssignmentDisposable(), self = this, p = this._p; if (isFunction(p)) { p = tryCatch(p)(); if (p === errorObj) { o.onError(p.e); return sad; } } p .then(function (data) { sad.setDisposable(self._s.schedule([o, data], scheduleNext)); }, function (err) { sad.setDisposable(self._s.schedule([o, err], scheduleError)); }); return sad; }; return FromPromiseObservable; }(ObservableBase)); /** * Converts a Promise to an Observable sequence * @param {Promise} An ES6 Compliant promise. * @returns {Observable} An Observable sequence which wraps the existing promise success and failure. */ var observableFromPromise = Observable.fromPromise = function (promise, scheduler) { scheduler || (scheduler = defaultScheduler); return new FromPromiseObservable(promise, scheduler); }; /* * Converts an existing observable sequence to an ES6 Compatible Promise * @example * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); * * // With config * Rx.config.Promise = RSVP.Promise; * var promise = Rx.Observable.return(42).toPromise(); * @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise. * @returns {Promise} An ES6 compatible promise with the last value from the observable sequence. */ observableProto.toPromise = function (promiseCtor) { promiseCtor || (promiseCtor = Rx.config.Promise); if (!promiseCtor) { throw new NotSupportedError('Promise type not provided nor in Rx.config.Promise'); } var source = this; return new promiseCtor(function (resolve, reject) { // No cancellation can be done var value; source.subscribe(function (v) { value = v; }, reject, function () { resolve(value); }); }); }; var ToArrayObservable = (function(__super__) { inherits(ToArrayObservable, __super__); function ToArrayObservable(source) { this.source = source; __super__.call(this); } ToArrayObservable.prototype.subscribeCore = function(o) { return this.source.subscribe(new InnerObserver(o)); }; inherits(InnerObserver, AbstractObserver); function InnerObserver(o) { this.o = o; this.a = []; AbstractObserver.call(this); } InnerObserver.prototype.next = function (x) { this.a.push(x); }; InnerObserver.prototype.error = function (e) { this.o.onError(e); }; InnerObserver.prototype.completed = function () { this.o.onNext(this.a); this.o.onCompleted(); }; return ToArrayObservable; }(ObservableBase)); /** * Creates an array from an observable sequence. * @returns {Observable} An observable sequence containing a single element with a list containing all the elements of the source sequence. */ observableProto.toArray = function () { return new ToArrayObservable(this); }; /** * Creates an observable sequence from a specified subscribe method implementation. * @example * var res = Rx.Observable.create(function (observer) { return function () { } ); * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } ); * var res = Rx.Observable.create(function (observer) { } ); * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable. * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method. */ Observable.create = function (subscribe, parent) { return new AnonymousObservable(subscribe, parent); }; var Defer = (function(__super__) { inherits(Defer, __super__); function Defer(factory) { this._f = factory; __super__.call(this); } Defer.prototype.subscribeCore = function (o) { var result = tryCatch(this._f)(); if (result === errorObj) { return observableThrow(result.e).subscribe(o);} isPromise(result) && (result = observableFromPromise(result)); return result.subscribe(o); }; return Defer; }(ObservableBase)); /** * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. * * @example * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); }); * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise. * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function. */ var observableDefer = Observable.defer = function (observableFactory) { return new Defer(observableFactory); }; var EmptyObservable = (function(__super__) { inherits(EmptyObservable, __super__); function EmptyObservable(scheduler) { this.scheduler = scheduler; __super__.call(this); } EmptyObservable.prototype.subscribeCore = function (observer) { var sink = new EmptySink(observer, this.scheduler); return sink.run(); }; function EmptySink(observer, scheduler) { this.observer = observer; this.scheduler = scheduler; } function scheduleItem(s, state) { state.onCompleted(); return disposableEmpty; } EmptySink.prototype.run = function () { var state = this.observer; return this.scheduler === immediateScheduler ? scheduleItem(null, state) : this.scheduler.schedule(state, scheduleItem); }; return EmptyObservable; }(ObservableBase)); var EMPTY_OBSERVABLE = new EmptyObservable(immediateScheduler); /** * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message. * * @example * var res = Rx.Observable.empty(); * var res = Rx.Observable.empty(Rx.Scheduler.timeout); * @param {Scheduler} [scheduler] Scheduler to send the termination call on. * @returns {Observable} An observable sequence with no elements. */ var observableEmpty = Observable.empty = function (scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return scheduler === immediateScheduler ? EMPTY_OBSERVABLE : new EmptyObservable(scheduler); }; var FromObservable = (function(__super__) { inherits(FromObservable, __super__); function FromObservable(iterable, fn, scheduler) { this._iterable = iterable; this._fn = fn; this._scheduler = scheduler; __super__.call(this); } function createScheduleMethod(o, it, fn) { return function loopRecursive(i, recurse) { var next = tryCatch(it.next).call(it); if (next === errorObj) { return o.onError(next.e); } if (next.done) { return o.onCompleted(); } var result = next.value; if (isFunction(fn)) { result = tryCatch(fn)(result, i); if (result === errorObj) { return o.onError(result.e); } } o.onNext(result); recurse(i + 1); }; } FromObservable.prototype.subscribeCore = function (o) { var list = Object(this._iterable), it = getIterable(list); return this._scheduler.scheduleRecursive(0, createScheduleMethod(o, it, this._fn)); }; return FromObservable; }(ObservableBase)); var maxSafeInteger = Math.pow(2, 53) - 1; function StringIterable(s) { this._s = s; } StringIterable.prototype[$iterator$] = function () { return new StringIterator(this._s); }; function StringIterator(s) { this._s = s; this._l = s.length; this._i = 0; } StringIterator.prototype[$iterator$] = function () { return this; }; StringIterator.prototype.next = function () { return this._i < this._l ? { done: false, value: this._s.charAt(this._i++) } : doneEnumerator; }; function ArrayIterable(a) { this._a = a; } ArrayIterable.prototype[$iterator$] = function () { return new ArrayIterator(this._a); }; function ArrayIterator(a) { this._a = a; this._l = toLength(a); this._i = 0; } ArrayIterator.prototype[$iterator$] = function () { return this; }; ArrayIterator.prototype.next = function () { return this._i < this._l ? { done: false, value: this._a[this._i++] } : doneEnumerator; }; function numberIsFinite(value) { return typeof value === 'number' && root.isFinite(value); } function isNan(n) { return n !== n; } function getIterable(o) { var i = o[$iterator$], it; if (!i && typeof o === 'string') { it = new StringIterable(o); return it[$iterator$](); } if (!i && o.length !== undefined) { it = new ArrayIterable(o); return it[$iterator$](); } if (!i) { throw new TypeError('Object is not iterable'); } return o[$iterator$](); } function sign(value) { var number = +value; if (number === 0) { return number; } if (isNaN(number)) { return number; } return number < 0 ? -1 : 1; } function toLength(o) { var len = +o.length; if (isNaN(len)) { return 0; } if (len === 0 || !numberIsFinite(len)) { return len; } len = sign(len) * Math.floor(Math.abs(len)); if (len <= 0) { return 0; } if (len > maxSafeInteger) { return maxSafeInteger; } return len; } /** * This method creates a new Observable sequence from an array-like or iterable object. * @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence. * @param {Function} [mapFn] Map function to call on every element of the array. * @param {Any} [thisArg] The context to use calling the mapFn if provided. * @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. */ var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) { if (iterable == null) { throw new Error('iterable cannot be null.') } if (mapFn && !isFunction(mapFn)) { throw new Error('mapFn when provided must be a function'); } if (mapFn) { var mapper = bindCallback(mapFn, thisArg, 2); } isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new FromObservable(iterable, mapper, scheduler); } var FromArrayObservable = (function(__super__) { inherits(FromArrayObservable, __super__); function FromArrayObservable(args, scheduler) { this._args = args; this._scheduler = scheduler; __super__.call(this); } function scheduleMethod(o, args) { var len = args.length; return function loopRecursive (i, recurse) { if (i < len) { o.onNext(args[i]); recurse(i + 1); } else { o.onCompleted(); } }; } FromArrayObservable.prototype.subscribeCore = function (o) { return this._scheduler.scheduleRecursive(0, scheduleMethod(o, this._args)); }; return FromArrayObservable; }(ObservableBase)); /** * Converts an array to an observable sequence, using an optional scheduler to enumerate the array. * @deprecated use Observable.from or Observable.of * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence. */ var observableFromArray = Observable.fromArray = function (array, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new FromArrayObservable(array, scheduler) }; var GenerateObservable = (function (__super__) { inherits(GenerateObservable, __super__); function GenerateObservable(state, cndFn, itrFn, resFn, s) { this._initialState = state; this._cndFn = cndFn; this._itrFn = itrFn; this._resFn = resFn; this._s = s; __super__.call(this); } function scheduleRecursive(state, recurse) { if (state.first) { state.first = false; } else { state.newState = tryCatch(state.self._itrFn)(state.newState); if (state.newState === errorObj) { return state.o.onError(state.newState.e); } } var hasResult = tryCatch(state.self._cndFn)(state.newState); if (hasResult === errorObj) { return state.o.onError(hasResult.e); } if (hasResult) { var result = tryCatch(state.self._resFn)(state.newState); if (result === errorObj) { return state.o.onError(result.e); } state.o.onNext(result); recurse(state); } else { state.o.onCompleted(); } } GenerateObservable.prototype.subscribeCore = function (o) { var state = { o: o, self: this, first: true, newState: this._initialState }; return this._s.scheduleRecursive(state, scheduleRecursive); }; return GenerateObservable; }(ObservableBase)); /** * Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }); * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout); * @param {Mixed} initialState Initial state. * @param {Function} condition Condition to terminate generation (upon returning false). * @param {Function} iterate Iteration step function. * @param {Function} resultSelector Selector function for results produced in the sequence. * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread. * @returns {Observable} The generated sequence. */ Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new GenerateObservable(initialState, condition, iterate, resultSelector, scheduler); }; function observableOf (scheduler, array) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new FromArrayObservable(array, scheduler); } /** * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. */ Observable.of = function () { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } return new FromArrayObservable(args, currentThreadScheduler); }; /** * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @param {Scheduler} scheduler A scheduler to use for scheduling the arguments. * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. */ Observable.ofWithScheduler = function (scheduler) { var len = arguments.length, args = new Array(len - 1); for(var i = 1; i < len; i++) { args[i - 1] = arguments[i]; } return new FromArrayObservable(args, scheduler); }; var NeverObservable = (function(__super__) { inherits(NeverObservable, __super__); function NeverObservable() { __super__.call(this); } NeverObservable.prototype.subscribeCore = function (observer) { return disposableEmpty; }; return NeverObservable; }(ObservableBase)); var NEVER_OBSERVABLE = new NeverObservable(); /** * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins). * @returns {Observable} An observable sequence whose observers will never get called. */ var observableNever = Observable.never = function () { return NEVER_OBSERVABLE; }; var PairsObservable = (function(__super__) { inherits(PairsObservable, __super__); function PairsObservable(o, scheduler) { this._o = o; this._keys = Object.keys(o); this._scheduler = scheduler; __super__.call(this); } function scheduleMethod(o, obj, keys) { return function loopRecursive(i, recurse) { if (i < keys.length) { var key = keys[i]; o.onNext([key, obj[key]]); recurse(i + 1); } else { o.onCompleted(); } }; } PairsObservable.prototype.subscribeCore = function (o) { return this._scheduler.scheduleRecursive(0, scheduleMethod(o, this._o, this._keys)); }; return PairsObservable; }(ObservableBase)); /** * Convert an object into an observable sequence of [key, value] pairs. * @param {Object} obj The object to inspect. * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. * @returns {Observable} An observable sequence of [key, value] pairs from the object. */ Observable.pairs = function (obj, scheduler) { scheduler || (scheduler = currentThreadScheduler); return new PairsObservable(obj, scheduler); }; var RangeObservable = (function(__super__) { inherits(RangeObservable, __super__); function RangeObservable(start, count, scheduler) { this.start = start; this.rangeCount = count; this.scheduler = scheduler; __super__.call(this); } function loopRecursive(start, count, o) { return function loop (i, recurse) { if (i < count) { o.onNext(start + i); recurse(i + 1); } else { o.onCompleted(); } }; } RangeObservable.prototype.subscribeCore = function (o) { return this.scheduler.scheduleRecursive( 0, loopRecursive(this.start, this.rangeCount, o) ); }; return RangeObservable; }(ObservableBase)); /** * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages. * @param {Number} start The value of the first integer in the sequence. * @param {Number} count The number of sequential integers to generate. * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread. * @returns {Observable} An observable sequence that contains a range of sequential integral numbers. */ Observable.range = function (start, count, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new RangeObservable(start, count, scheduler); }; var RepeatObservable = (function(__super__) { inherits(RepeatObservable, __super__); function RepeatObservable(value, repeatCount, scheduler) { this.value = value; this.repeatCount = repeatCount == null ? -1 : repeatCount; this.scheduler = scheduler; __super__.call(this); } RepeatObservable.prototype.subscribeCore = function (observer) { var sink = new RepeatSink(observer, this); return sink.run(); }; return RepeatObservable; }(ObservableBase)); function RepeatSink(observer, parent) { this.observer = observer; this.parent = parent; } RepeatSink.prototype.run = function () { var observer = this.observer, value = this.parent.value; function loopRecursive(i, recurse) { if (i === -1 || i > 0) { observer.onNext(value); i > 0 && i--; } if (i === 0) { return observer.onCompleted(); } recurse(i); } return this.parent.scheduler.scheduleRecursive(this.parent.repeatCount, loopRecursive); }; /** * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages. * @param {Mixed} value Element to repeat. * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely. * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence that repeats the given element the specified number of times. */ Observable.repeat = function (value, repeatCount, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new RepeatObservable(value, repeatCount, scheduler); }; var JustObservable = (function(__super__) { inherits(JustObservable, __super__); function JustObservable(value, scheduler) { this._value = value; this._scheduler = scheduler; __super__.call(this); } JustObservable.prototype.subscribeCore = function (o) { var state = [this._value, o]; return this._scheduler === immediateScheduler ? scheduleItem(null, state) : this._scheduler.schedule(state, scheduleItem); }; function scheduleItem(s, state) { var value = state[0], observer = state[1]; observer.onNext(value); observer.onCompleted(); return disposableEmpty; } return JustObservable; }(ObservableBase)); /** * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages. * There is an alias called 'just' or browsers 0) { this.parent.handleSubscribe(this.parent.q.shift()); } else { this.parent.activeCount--; this.parent.done && this.parent.activeCount === 0 && this.parent.o.onCompleted(); } }; return MergeObserver; }(AbstractObserver)); /** * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences. * Or merges two observable sequences into a single observable sequence. * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.merge = function (maxConcurrentOrOther) { return typeof maxConcurrentOrOther !== 'number' ? observableMerge(this, maxConcurrentOrOther) : new MergeObservable(this, maxConcurrentOrOther); }; /** * Merges all the observable sequences into a single observable sequence. * The scheduler is optional and if not specified, the immediate scheduler is used. * @returns {Observable} The observable sequence that merges the elements of the observable sequences. */ var observableMerge = Observable.merge = function () { var scheduler, sources = [], i, len = arguments.length; if (!arguments[0]) { scheduler = immediateScheduler; for(i = 1; i < len; i++) { sources.push(arguments[i]); } } else if (isScheduler(arguments[0])) { scheduler = arguments[0]; for(i = 1; i < len; i++) { sources.push(arguments[i]); } } else { scheduler = immediateScheduler; for(i = 0; i < len; i++) { sources.push(arguments[i]); } } if (Array.isArray(sources[0])) { sources = sources[0]; } return observableOf(scheduler, sources).mergeAll(); }; var MergeAllObservable = (function (__super__) { inherits(MergeAllObservable, __super__); function MergeAllObservable(source) { this.source = source; __super__.call(this); } MergeAllObservable.prototype.subscribeCore = function (o) { var g = new CompositeDisposable(), m = new SingleAssignmentDisposable(); g.add(m); m.setDisposable(this.source.subscribe(new MergeAllObserver(o, g))); return g; }; return MergeAllObservable; }(ObservableBase)); var MergeAllObserver = (function (__super__) { function MergeAllObserver(o, g) { this.o = o; this.g = g; this.done = false; __super__.call(this); } inherits(MergeAllObserver, __super__); MergeAllObserver.prototype.next = function(innerSource) { var sad = new SingleAssignmentDisposable(); this.g.add(sad); isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); sad.setDisposable(innerSource.subscribe(new InnerObserver(this, sad))); }; MergeAllObserver.prototype.error = function (e) { this.o.onError(e); }; MergeAllObserver.prototype.completed = function () { this.done = true; this.g.length === 1 && this.o.onCompleted(); }; function InnerObserver(parent, sad) { this.parent = parent; this.sad = sad; __super__.call(this); } inherits(InnerObserver, __super__); InnerObserver.prototype.next = function (x) { this.parent.o.onNext(x); }; InnerObserver.prototype.error = function (e) { this.parent.o.onError(e); }; InnerObserver.prototype.completed = function () { this.parent.g.remove(this.sad); this.parent.done && this.parent.g.length === 1 && this.parent.o.onCompleted(); }; return MergeAllObserver; }(AbstractObserver)); /** * Merges an observable sequence of observable sequences into an observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.mergeAll = function () { return new MergeAllObservable(this); }; var CompositeError = Rx.CompositeError = function(errors) { this.innerErrors = errors; this.message = 'This contains multiple errors. Check the innerErrors'; Error.call(this); }; CompositeError.prototype = Object.create(Error.prototype); CompositeError.prototype.name = 'CompositeError'; var MergeDelayErrorObservable = (function(__super__) { inherits(MergeDelayErrorObservable, __super__); function MergeDelayErrorObservable(source) { this.source = source; __super__.call(this); } MergeDelayErrorObservable.prototype.subscribeCore = function (o) { var group = new CompositeDisposable(), m = new SingleAssignmentDisposable(), state = { isStopped: false, errors: [], o: o }; group.add(m); m.setDisposable(this.source.subscribe(new MergeDelayErrorObserver(group, state))); return group; }; return MergeDelayErrorObservable; }(ObservableBase)); var MergeDelayErrorObserver = (function(__super__) { inherits(MergeDelayErrorObserver, __super__); function MergeDelayErrorObserver(group, state) { this._group = group; this._state = state; __super__.call(this); } function setCompletion(o, errors) { if (errors.length === 0) { o.onCompleted(); } else if (errors.length === 1) { o.onError(errors[0]); } else { o.onError(new CompositeError(errors)); } } MergeDelayErrorObserver.prototype.next = function (x) { var inner = new SingleAssignmentDisposable(); this._group.add(inner); // Check for promises support isPromise(x) && (x = observableFromPromise(x)); inner.setDisposable(x.subscribe(new InnerObserver(inner, this._group, this._state))); }; MergeDelayErrorObserver.prototype.error = function (e) { this._state.errors.push(e); this._state.isStopped = true; this._group.length === 1 && setCompletion(this._state.o, this._state.errors); }; MergeDelayErrorObserver.prototype.completed = function () { this._state.isStopped = true; this._group.length === 1 && setCompletion(this._state.o, this._state.errors); }; inherits(InnerObserver, __super__); function InnerObserver(inner, group, state) { this._inner = inner; this._group = group; this._state = state; __super__.call(this); } InnerObserver.prototype.next = function (x) { this._state.o.onNext(x); }; InnerObserver.prototype.error = function (e) { this._state.errors.push(e); this._group.remove(this._inner); this._state.isStopped && this._group.length === 1 && setCompletion(this._state.o, this._state.errors); }; InnerObserver.prototype.completed = function () { this._group.remove(this._inner); this._state.isStopped && this._group.length === 1 && setCompletion(this._state.o, this._state.errors); }; return MergeDelayErrorObserver; }(AbstractObserver)); /** * Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to * receive all successfully emitted items from all of the source Observables without being interrupted by * an error notification from one of them. * * This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an * error via the Observer's onError, mergeDelayError will refrain from propagating that * error notification until all of the merged Observables have finished emitting items. * @param {Array | Arguments} args Arguments or an array to merge. * @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable */ Observable.mergeDelayError = function() { var args; if (Array.isArray(arguments[0])) { args = arguments[0]; } else { var len = arguments.length; args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } } var source = observableOf(null, args); return new MergeDelayErrorObservable(source); }; /** * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. * @param {Observable} second Second observable sequence used to produce results after the first sequence terminates. * @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally. */ observableProto.onErrorResumeNext = function (second) { if (!second) { throw new Error('Second observable is required'); } return onErrorResumeNext([this, second]); }; var OnErrorResumeNextObservable = (function(__super__) { inherits(OnErrorResumeNextObservable, __super__); function OnErrorResumeNextObservable(sources) { this.sources = sources; __super__.call(this); } function scheduleMethod(state, recurse) { if (state.pos < state.sources.length) { var current = state.sources[state.pos++]; isPromise(current) && (current = observableFromPromise(current)); var d = new SingleAssignmentDisposable(); state.subscription.setDisposable(d); d.setDisposable(current.subscribe(new OnErrorResumeNextObserver(state, recurse))); } else { state.o.onCompleted(); } } OnErrorResumeNextObservable.prototype.subscribeCore = function (o) { var subscription = new SerialDisposable(), state = {pos: 0, subscription: subscription, o: o, sources: this.sources }, cancellable = immediateScheduler.scheduleRecursive(state, scheduleMethod); return new BinaryDisposable(subscription, cancellable); }; return OnErrorResumeNextObservable; }(ObservableBase)); var OnErrorResumeNextObserver = (function(__super__) { inherits(OnErrorResumeNextObserver, __super__); function OnErrorResumeNextObserver(state, recurse) { this._state = state; this._recurse = recurse; __super__.call(this); } OnErrorResumeNextObserver.prototype.next = function (x) { this._state.o.onNext(x); }; OnErrorResumeNextObserver.prototype.error = function () { this._recurse(this._state); }; OnErrorResumeNextObserver.prototype.completed = function () { this._recurse(this._state); }; return OnErrorResumeNextObserver; }(AbstractObserver)); /** * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. * @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally. */ var onErrorResumeNext = Observable.onErrorResumeNext = function () { var sources = []; if (Array.isArray(arguments[0])) { sources = arguments[0]; } else { var len = arguments.length; sources = new Array(len); for(var i = 0; i < len; i++) { sources[i] = arguments[i]; } } return new OnErrorResumeNextObservable(sources); }; var SkipUntilObservable = (function(__super__) { inherits(SkipUntilObservable, __super__); function SkipUntilObservable(source, other) { this._s = source; this._o = isPromise(other) ? observableFromPromise(other) : other; this._open = false; __super__.call(this); } SkipUntilObservable.prototype.subscribeCore = function(o) { var leftSubscription = new SingleAssignmentDisposable(); leftSubscription.setDisposable(this._s.subscribe(new SkipUntilSourceObserver(o, this))); isPromise(this._o) && (this._o = observableFromPromise(this._o)); var rightSubscription = new SingleAssignmentDisposable(); rightSubscription.setDisposable(this._o.subscribe(new SkipUntilOtherObserver(o, this, rightSubscription))); return new BinaryDisposable(leftSubscription, rightSubscription); }; return SkipUntilObservable; }(ObservableBase)); var SkipUntilSourceObserver = (function(__super__) { inherits(SkipUntilSourceObserver, __super__); function SkipUntilSourceObserver(o, p) { this._o = o; this._p = p; __super__.call(this); } SkipUntilSourceObserver.prototype.next = function (x) { this._p._open && this._o.onNext(x); }; SkipUntilSourceObserver.prototype.error = function (err) { this._o.onError(err); }; SkipUntilSourceObserver.prototype.onCompleted = function () { this._p._open && this._o.onCompleted(); }; return SkipUntilSourceObserver; }(AbstractObserver)); var SkipUntilOtherObserver = (function(__super__) { inherits(SkipUntilOtherObserver, __super__); function SkipUntilOtherObserver(o, p, r) { this._o = o; this._p = p; this._r = r; __super__.call(this); } SkipUntilOtherObserver.prototype.next = function () { this._p._open = true; this._r.dispose(); }; SkipUntilOtherObserver.prototype.error = function (err) { this._o.onError(err); }; SkipUntilOtherObserver.prototype.onCompleted = function () { this._r.dispose(); }; return SkipUntilOtherObserver; }(AbstractObserver)); /** * Returns the values from the source observable sequence only after the other observable sequence produces a value. * @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation. */ observableProto.skipUntil = function (other) { return new SkipUntilObservable(this, other); }; var SwitchObservable = (function(__super__) { inherits(SwitchObservable, __super__); function SwitchObservable(source) { this.source = source; __super__.call(this); } SwitchObservable.prototype.subscribeCore = function (o) { var inner = new SerialDisposable(), s = this.source.subscribe(new SwitchObserver(o, inner)); return new BinaryDisposable(s, inner); }; inherits(SwitchObserver, AbstractObserver); function SwitchObserver(o, inner) { this.o = o; this.inner = inner; this.stopped = false; this.latest = 0; this.hasLatest = false; AbstractObserver.call(this); } SwitchObserver.prototype.next = function (innerSource) { var d = new SingleAssignmentDisposable(), id = ++this.latest; this.hasLatest = true; this.inner.setDisposable(d); isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); d.setDisposable(innerSource.subscribe(new InnerObserver(this, id))); }; SwitchObserver.prototype.error = function (e) { this.o.onError(e); }; SwitchObserver.prototype.completed = function () { this.stopped = true; !this.hasLatest && this.o.onCompleted(); }; inherits(InnerObserver, AbstractObserver); function InnerObserver(parent, id) { this.parent = parent; this.id = id; AbstractObserver.call(this); } InnerObserver.prototype.next = function (x) { this.parent.latest === this.id && this.parent.o.onNext(x); }; InnerObserver.prototype.error = function (e) { this.parent.latest === this.id && this.parent.o.onError(e); }; InnerObserver.prototype.completed = function () { if (this.parent.latest === this.id) { this.parent.hasLatest = false; this.parent.stopped && this.parent.o.onCompleted(); } }; return SwitchObservable; }(ObservableBase)); /** * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto['switch'] = observableProto.switchLatest = function () { return new SwitchObservable(this); }; var TakeUntilObservable = (function(__super__) { inherits(TakeUntilObservable, __super__); function TakeUntilObservable(source, other) { this.source = source; this.other = isPromise(other) ? observableFromPromise(other) : other; __super__.call(this); } TakeUntilObservable.prototype.subscribeCore = function(o) { return new BinaryDisposable( this.source.subscribe(o), this.other.subscribe(new TakeUntilObserver(o)) ); }; return TakeUntilObservable; }(ObservableBase)); var TakeUntilObserver = (function(__super__) { inherits(TakeUntilObserver, __super__); function TakeUntilObserver(o) { this._o = o; __super__.call(this); } TakeUntilObserver.prototype.next = function () { this._o.onCompleted(); }; TakeUntilObserver.prototype.error = function (err) { this._o.onError(err); }; TakeUntilObserver.prototype.onCompleted = noop; return TakeUntilObserver; }(AbstractObserver)); /** * Returns the values from the source observable sequence until the other observable sequence produces a value. * @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. */ observableProto.takeUntil = function (other) { return new TakeUntilObservable(this, other); }; function falseFactory() { return false; } function argumentsToArray() { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } return args; } var WithLatestFromObservable = (function(__super__) { inherits(WithLatestFromObservable, __super__); function WithLatestFromObservable(source, sources, resultSelector) { this._s = source; this._ss = sources; this._cb = resultSelector; __super__.call(this); } WithLatestFromObservable.prototype.subscribeCore = function (o) { var len = this._ss.length; var state = { hasValue: arrayInitialize(len, falseFactory), hasValueAll: false, values: new Array(len) }; var n = this._ss.length, subscriptions = new Array(n + 1); for (var i = 0; i < n; i++) { var other = this._ss[i], sad = new SingleAssignmentDisposable(); isPromise(other) && (other = observableFromPromise(other)); sad.setDisposable(other.subscribe(new WithLatestFromOtherObserver(o, i, state))); subscriptions[i] = sad; } var outerSad = new SingleAssignmentDisposable(); outerSad.setDisposable(this._s.subscribe(new WithLatestFromSourceObserver(o, this._cb, state))); subscriptions[n] = outerSad; return new NAryDisposable(subscriptions); }; return WithLatestFromObservable; }(ObservableBase)); var WithLatestFromOtherObserver = (function (__super__) { inherits(WithLatestFromOtherObserver, __super__); function WithLatestFromOtherObserver(o, i, state) { this._o = o; this._i = i; this._state = state; __super__.call(this); } WithLatestFromOtherObserver.prototype.next = function (x) { this._state.values[this._i] = x; this._state.hasValue[this._i] = true; this._state.hasValueAll = this._state.hasValue.every(identity); }; WithLatestFromOtherObserver.prototype.error = function (e) { this._o.onError(e); }; WithLatestFromOtherObserver.prototype.completed = noop; return WithLatestFromOtherObserver; }(AbstractObserver)); var WithLatestFromSourceObserver = (function (__super__) { inherits(WithLatestFromSourceObserver, __super__); function WithLatestFromSourceObserver(o, cb, state) { this._o = o; this._cb = cb; this._state = state; __super__.call(this); } WithLatestFromSourceObserver.prototype.next = function (x) { var allValues = [x].concat(this._state.values); if (!this._state.hasValueAll) { return; } var res = tryCatch(this._cb).apply(null, allValues); if (res === errorObj) { return this._o.onError(res.e); } this._o.onNext(res); }; WithLatestFromSourceObserver.prototype.error = function (e) { this._o.onError(e); }; WithLatestFromSourceObserver.prototype.completed = function () { this._o.onCompleted(); }; return WithLatestFromSourceObserver; }(AbstractObserver)); /** * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.withLatestFrom = function () { if (arguments.length === 0) { throw new Error('invalid arguments'); } var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } var resultSelector = isFunction(args[len - 1]) ? args.pop() : argumentsToArray; Array.isArray(args[0]) && (args = args[0]); return new WithLatestFromObservable(this, args, resultSelector); }; function falseFactory() { return false; } function emptyArrayFactory() { return []; } var ZipObservable = (function(__super__) { inherits(ZipObservable, __super__); function ZipObservable(sources, resultSelector) { this._s = sources; this._cb = resultSelector; __super__.call(this); } ZipObservable.prototype.subscribeCore = function(observer) { var n = this._s.length, subscriptions = new Array(n), done = arrayInitialize(n, falseFactory), q = arrayInitialize(n, emptyArrayFactory); for (var i = 0; i < n; i++) { var source = this._s[i], sad = new SingleAssignmentDisposable(); subscriptions[i] = sad; isPromise(source) && (source = observableFromPromise(source)); sad.setDisposable(source.subscribe(new ZipObserver(observer, i, this, q, done))); } return new NAryDisposable(subscriptions); }; return ZipObservable; }(ObservableBase)); var ZipObserver = (function (__super__) { inherits(ZipObserver, __super__); function ZipObserver(o, i, p, q, d) { this._o = o; this._i = i; this._p = p; this._q = q; this._d = d; __super__.call(this); } function notEmpty(x) { return x.length > 0; } function shiftEach(x) { return x.shift(); } function notTheSame(i) { return function (x, j) { return j !== i; }; } ZipObserver.prototype.next = function (x) { this._q[this._i].push(x); if (this._q.every(notEmpty)) { var queuedValues = this._q.map(shiftEach); var res = tryCatch(this._p._cb).apply(null, queuedValues); if (res === errorObj) { return this._o.onError(res.e); } this._o.onNext(res); } else if (this._d.filter(notTheSame(this._i)).every(identity)) { this._o.onCompleted(); } }; ZipObserver.prototype.error = function (e) { this._o.onError(e); }; ZipObserver.prototype.completed = function () { this._d[this._i] = true; this._d.every(identity) && this._o.onCompleted(); }; return ZipObserver; }(AbstractObserver)); /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args. * @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function. */ observableProto.zip = function () { if (arguments.length === 0) { throw new Error('invalid arguments'); } var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } var resultSelector = isFunction(args[len - 1]) ? args.pop() : argumentsToArray; Array.isArray(args[0]) && (args = args[0]); var parent = this; args.unshift(parent); return new ZipObservable(args, resultSelector); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. * @param arguments Observable sources. * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ Observable.zip = function () { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } if (Array.isArray(args[0])) { args = isFunction(args[1]) ? args[0].concat(args[1]) : args[0]; } var first = args.shift(); return first.zip.apply(first, args); }; function falseFactory() { return false; } function emptyArrayFactory() { return []; } function argumentsToArray() { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } return args; } var ZipIterableObservable = (function(__super__) { inherits(ZipIterableObservable, __super__); function ZipIterableObservable(sources, cb) { this.sources = sources; this._cb = cb; __super__.call(this); } ZipIterableObservable.prototype.subscribeCore = function (o) { var sources = this.sources, len = sources.length, subscriptions = new Array(len); var state = { q: arrayInitialize(len, emptyArrayFactory), done: arrayInitialize(len, falseFactory), cb: this._cb, o: o }; for (var i = 0; i < len; i++) { (function (i) { var source = sources[i], sad = new SingleAssignmentDisposable(); (isArrayLike(source) || isIterable(source)) && (source = observableFrom(source)); subscriptions[i] = sad; sad.setDisposable(source.subscribe(new ZipIterableObserver(state, i))); }(i)); } return new NAryDisposable(subscriptions); }; return ZipIterableObservable; }(ObservableBase)); var ZipIterableObserver = (function (__super__) { inherits(ZipIterableObserver, __super__); function ZipIterableObserver(s, i) { this._s = s; this._i = i; __super__.call(this); } function notEmpty(x) { return x.length > 0; } function shiftEach(x) { return x.shift(); } function notTheSame(i) { return function (x, j) { return j !== i; }; } ZipIterableObserver.prototype.next = function (x) { this._s.q[this._i].push(x); if (this._s.q.every(notEmpty)) { var queuedValues = this._s.q.map(shiftEach), res = tryCatch(this._s.cb).apply(null, queuedValues); if (res === errorObj) { return this._s.o.onError(res.e); } this._s.o.onNext(res); } else if (this._s.done.filter(notTheSame(this._i)).every(identity)) { this._s.o.onCompleted(); } }; ZipIterableObserver.prototype.error = function (e) { this._s.o.onError(e); }; ZipIterableObserver.prototype.completed = function () { this._s.done[this._i] = true; this._s.done.every(identity) && this._s.o.onCompleted(); }; return ZipIterableObserver; }(AbstractObserver)); /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args. * @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function. */ observableProto.zipIterable = function () { if (arguments.length === 0) { throw new Error('invalid arguments'); } var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } var resultSelector = isFunction(args[len - 1]) ? args.pop() : argumentsToArray; var parent = this; args.unshift(parent); return new ZipIterableObservable(args, resultSelector); }; function asObservable(source) { return function subscribe(o) { return source.subscribe(o); }; } /** * Hides the identity of an observable sequence. * @returns {Observable} An observable sequence that hides the identity of the source sequence. */ observableProto.asObservable = function () { return new AnonymousObservable(asObservable(this), this); }; function toArray(x) { return x.toArray(); } function notEmpty(x) { return x.length > 0; } /** * Projects each element of an observable sequence into zero or more buffers which are produced based on element count information. * @param {Number} count Length of each buffer. * @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count. * @returns {Observable} An observable sequence of buffers. */ observableProto.bufferWithCount = observableProto.bufferCount = function (count, skip) { typeof skip !== 'number' && (skip = count); return this.windowWithCount(count, skip) .flatMap(toArray) .filter(notEmpty); }; var DematerializeObservable = (function (__super__) { inherits(DematerializeObservable, __super__); function DematerializeObservable(source) { this.source = source; __super__.call(this); } DematerializeObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new DematerializeObserver(o)); }; return DematerializeObservable; }(ObservableBase)); var DematerializeObserver = (function (__super__) { inherits(DematerializeObserver, __super__); function DematerializeObserver(o) { this._o = o; __super__.call(this); } DematerializeObserver.prototype.next = function (x) { x.accept(this._o); }; DematerializeObserver.prototype.error = function (e) { this._o.onError(e); }; DematerializeObserver.prototype.completed = function () { this._o.onCompleted(); }; return DematerializeObserver; }(AbstractObserver)); /** * Dematerializes the explicit notification values of an observable sequence as implicit notifications. * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. */ observableProto.dematerialize = function () { return new DematerializeObservable(this); }; var DistinctUntilChangedObservable = (function(__super__) { inherits(DistinctUntilChangedObservable, __super__); function DistinctUntilChangedObservable(source, keyFn, comparer) { this.source = source; this.keyFn = keyFn; this.comparer = comparer; __super__.call(this); } DistinctUntilChangedObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new DistinctUntilChangedObserver(o, this.keyFn, this.comparer)); }; return DistinctUntilChangedObservable; }(ObservableBase)); var DistinctUntilChangedObserver = (function(__super__) { inherits(DistinctUntilChangedObserver, __super__); function DistinctUntilChangedObserver(o, keyFn, comparer) { this.o = o; this.keyFn = keyFn; this.comparer = comparer; this.hasCurrentKey = false; this.currentKey = null; __super__.call(this); } DistinctUntilChangedObserver.prototype.next = function (x) { var key = x, comparerEquals; if (isFunction(this.keyFn)) { key = tryCatch(this.keyFn)(x); if (key === errorObj) { return this.o.onError(key.e); } } if (this.hasCurrentKey) { comparerEquals = tryCatch(this.comparer)(this.currentKey, key); if (comparerEquals === errorObj) { return this.o.onError(comparerEquals.e); } } if (!this.hasCurrentKey || !comparerEquals) { this.hasCurrentKey = true; this.currentKey = key; this.o.onNext(x); } }; DistinctUntilChangedObserver.prototype.error = function(e) { this.o.onError(e); }; DistinctUntilChangedObserver.prototype.completed = function () { this.o.onCompleted(); }; return DistinctUntilChangedObserver; }(AbstractObserver)); /** * Returns an observable sequence that contains only distinct contiguous elements according to the keyFn and the comparer. * @param {Function} [keyFn] A function to compute the comparison key for each element. If not provided, it projects the value. * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function. * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. */ observableProto.distinctUntilChanged = function (keyFn, comparer) { comparer || (comparer = defaultComparer); return new DistinctUntilChangedObservable(this, keyFn, comparer); }; var TapObservable = (function(__super__) { inherits(TapObservable,__super__); function TapObservable(source, observerOrOnNext, onError, onCompleted) { this.source = source; this._oN = observerOrOnNext; this._oE = onError; this._oC = onCompleted; __super__.call(this); } TapObservable.prototype.subscribeCore = function(o) { return this.source.subscribe(new InnerObserver(o, this)); }; inherits(InnerObserver, AbstractObserver); function InnerObserver(o, p) { this.o = o; this.t = !p._oN || isFunction(p._oN) ? observerCreate(p._oN || noop, p._oE || noop, p._oC || noop) : p._oN; this.isStopped = false; AbstractObserver.call(this); } InnerObserver.prototype.next = function(x) { var res = tryCatch(this.t.onNext).call(this.t, x); if (res === errorObj) { this.o.onError(res.e); } this.o.onNext(x); }; InnerObserver.prototype.error = function(err) { var res = tryCatch(this.t.onError).call(this.t, err); if (res === errorObj) { return this.o.onError(res.e); } this.o.onError(err); }; InnerObserver.prototype.completed = function() { var res = tryCatch(this.t.onCompleted).call(this.t); if (res === errorObj) { return this.o.onError(res.e); } this.o.onCompleted(); }; return TapObservable; }(ObservableBase)); /** * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an o. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto['do'] = observableProto.tap = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) { return new TapObservable(this, observerOrOnNext, onError, onCompleted); }; /** * Invokes an action for each element in the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onNext Action to invoke for each element in the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) { return this.tap(typeof thisArg !== 'undefined' ? function (x) { onNext.call(thisArg, x); } : onNext); }; /** * Invokes an action upon exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onError Action to invoke upon exceptional termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) { return this.tap(noop, typeof thisArg !== 'undefined' ? function (e) { onError.call(thisArg, e); } : onError); }; /** * Invokes an action upon graceful termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) { return this.tap(noop, null, typeof thisArg !== 'undefined' ? function () { onCompleted.call(thisArg); } : onCompleted); }; var FinallyObservable = (function (__super__) { inherits(FinallyObservable, __super__); function FinallyObservable(source, fn, thisArg) { this.source = source; this._fn = bindCallback(fn, thisArg, 0); __super__.call(this); } FinallyObservable.prototype.subscribeCore = function (o) { var d = tryCatch(this.source.subscribe).call(this.source, o); if (d === errorObj) { this._fn(); thrower(d.e); } return new FinallyDisposable(d, this._fn); }; function FinallyDisposable(s, fn) { this.isDisposed = false; this._s = s; this._fn = fn; } FinallyDisposable.prototype.dispose = function () { if (!this.isDisposed) { var res = tryCatch(this._s.dispose).call(this._s); this._fn(); res === errorObj && thrower(res.e); } }; return FinallyObservable; }(ObservableBase)); /** * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally. * @param {Function} finallyAction Action to invoke after the source observable sequence terminates. * @returns {Observable} Source sequence with the action-invoking termination behavior applied. */ observableProto['finally'] = function (action, thisArg) { return new FinallyObservable(this, action, thisArg); }; var IgnoreElementsObservable = (function(__super__) { inherits(IgnoreElementsObservable, __super__); function IgnoreElementsObservable(source) { this.source = source; __super__.call(this); } IgnoreElementsObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new InnerObserver(o)); }; function InnerObserver(o) { this.o = o; this.isStopped = false; } InnerObserver.prototype.onNext = noop; InnerObserver.prototype.onError = function (err) { if(!this.isStopped) { this.isStopped = true; this.o.onError(err); } }; InnerObserver.prototype.onCompleted = function () { if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); } }; InnerObserver.prototype.dispose = function() { this.isStopped = true; }; InnerObserver.prototype.fail = function (e) { if (!this.isStopped) { this.isStopped = true; this.observer.onError(e); return true; } return false; }; return IgnoreElementsObservable; }(ObservableBase)); /** * Ignores all elements in an observable sequence leaving only the termination messages. * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence. */ observableProto.ignoreElements = function () { return new IgnoreElementsObservable(this); }; var MaterializeObservable = (function (__super__) { inherits(MaterializeObservable, __super__); function MaterializeObservable(source, fn) { this.source = source; __super__.call(this); } MaterializeObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new MaterializeObserver(o)); }; return MaterializeObservable; }(ObservableBase)); var MaterializeObserver = (function (__super__) { inherits(MaterializeObserver, __super__); function MaterializeObserver(o) { this._o = o; __super__.call(this); } MaterializeObserver.prototype.next = function (x) { this._o.onNext(notificationCreateOnNext(x)) }; MaterializeObserver.prototype.error = function (e) { this._o.onNext(notificationCreateOnError(e)); this._o.onCompleted(); }; MaterializeObserver.prototype.completed = function () { this._o.onNext(notificationCreateOnCompleted()); this._o.onCompleted(); }; return MaterializeObserver; }(AbstractObserver)); /** * Materializes the implicit notifications of an observable sequence as explicit notification values. * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence. */ observableProto.materialize = function () { return new MaterializeObservable(this); }; /** * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely. * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely. * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly. */ observableProto.repeat = function (repeatCount) { return enumerableRepeat(this, repeatCount).concat(); }; /** * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely. * Note if you encounter an error and want it to retry once, then you must use .retry(2); * * @example * var res = retried = retry.repeat(); * var res = retried = retry.repeat(2); * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely. * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. */ observableProto.retry = function (retryCount) { return enumerableRepeat(this, retryCount).catchError(); }; function repeat(value) { return { '@@iterator': function () { return { next: function () { return { done: false, value: value }; } }; } }; } var RetryWhenObservable = (function(__super__) { function createDisposable(state) { return { isDisposed: false, dispose: function () { if (!this.isDisposed) { this.isDisposed = true; state.isDisposed = true; } } }; } function RetryWhenObservable(source, notifier) { this.source = source; this._notifier = notifier; __super__.call(this); } inherits(RetryWhenObservable, __super__); RetryWhenObservable.prototype.subscribeCore = function (o) { var exceptions = new Subject(), notifier = new Subject(), handled = this._notifier(exceptions), notificationDisposable = handled.subscribe(notifier); var e = this.source['@@iterator'](); var state = { isDisposed: false }, lastError, subscription = new SerialDisposable(); var cancelable = currentThreadScheduler.scheduleRecursive(null, function (_, recurse) { if (state.isDisposed) { return; } var currentItem = e.next(); if (currentItem.done) { if (lastError) { o.onError(lastError); } else { o.onCompleted(); } return; } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var outer = new SingleAssignmentDisposable(); var inner = new SingleAssignmentDisposable(); subscription.setDisposable(new BinaryDisposable(inner, outer)); outer.setDisposable(currentValue.subscribe( function(x) { o.onNext(x); }, function (exn) { inner.setDisposable(notifier.subscribe(recurse, function(ex) { o.onError(ex); }, function() { o.onCompleted(); })); exceptions.onNext(exn); outer.dispose(); }, function() { o.onCompleted(); })); }); return new NAryDisposable([notificationDisposable, subscription, cancelable, createDisposable(state)]); }; return RetryWhenObservable; }(ObservableBase)); observableProto.retryWhen = function (notifier) { return new RetryWhenObservable(repeat(this), notifier); }; function repeat(value) { return { '@@iterator': function () { return { next: function () { return { done: false, value: value }; } }; } }; } var RepeatWhenObservable = (function(__super__) { function createDisposable(state) { return { isDisposed: false, dispose: function () { if (!this.isDisposed) { this.isDisposed = true; state.isDisposed = true; } } }; } function RepeatWhenObservable(source, notifier) { this.source = source; this._notifier = notifier; __super__.call(this); } inherits(RepeatWhenObservable, __super__); RepeatWhenObservable.prototype.subscribeCore = function (o) { var completions = new Subject(), notifier = new Subject(), handled = this._notifier(completions), notificationDisposable = handled.subscribe(notifier); var e = this.source['@@iterator'](); var state = { isDisposed: false }, lastError, subscription = new SerialDisposable(); var cancelable = currentThreadScheduler.scheduleRecursive(null, function (_, recurse) { if (state.isDisposed) { return; } var currentItem = e.next(); if (currentItem.done) { if (lastError) { o.onError(lastError); } else { o.onCompleted(); } return; } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var outer = new SingleAssignmentDisposable(); var inner = new SingleAssignmentDisposable(); subscription.setDisposable(new BinaryDisposable(inner, outer)); outer.setDisposable(currentValue.subscribe( function(x) { o.onNext(x); }, function (exn) { o.onError(exn); }, function() { inner.setDisposable(notifier.subscribe(recurse, function(ex) { o.onError(ex); }, function() { o.onCompleted(); })); completions.onNext(null); outer.dispose(); })); }); return new NAryDisposable([notificationDisposable, subscription, cancelable, createDisposable(state)]); }; return RepeatWhenObservable; }(ObservableBase)); observableProto.repeatWhen = function (notifier) { return new RepeatWhenObservable(repeat(this), notifier); }; var ScanObservable = (function(__super__) { inherits(ScanObservable, __super__); function ScanObservable(source, accumulator, hasSeed, seed) { this.source = source; this.accumulator = accumulator; this.hasSeed = hasSeed; this.seed = seed; __super__.call(this); } ScanObservable.prototype.subscribeCore = function(o) { return this.source.subscribe(new ScanObserver(o,this)); }; return ScanObservable; }(ObservableBase)); var ScanObserver = (function (__super__) { inherits(ScanObserver, __super__); function ScanObserver(o, parent) { this._o = o; this._p = parent; this._fn = parent.accumulator; this._hs = parent.hasSeed; this._s = parent.seed; this._ha = false; this._a = null; this._hv = false; this._i = 0; __super__.call(this); } ScanObserver.prototype.next = function (x) { !this._hv && (this._hv = true); if (this._ha) { this._a = tryCatch(this._fn)(this._a, x, this._i, this._p); } else { this._a = this._hs ? tryCatch(this._fn)(this._s, x, this._i, this._p) : x; this._ha = true; } if (this._a === errorObj) { return this._o.onError(this._a.e); } this._o.onNext(this._a); this._i++; }; ScanObserver.prototype.error = function (e) { this._o.onError(e); }; ScanObserver.prototype.completed = function () { !this._hv && this._hs && this._o.onNext(this._s); this._o.onCompleted(); }; return ScanObserver; }(AbstractObserver)); /** * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. * For aggregation behavior with no intermediate results, see Observable.aggregate. * @param {Mixed} [seed] The initial accumulator value. * @param {Function} accumulator An accumulator function to be invoked on each element. * @returns {Observable} An observable sequence containing the accumulated values. */ observableProto.scan = function () { var hasSeed = false, seed, accumulator = arguments[0]; if (arguments.length === 2) { hasSeed = true; seed = arguments[1]; } return new ScanObservable(this, accumulator, hasSeed, seed); }; var SkipLastObservable = (function (__super__) { inherits(SkipLastObservable, __super__); function SkipLastObservable(source, c) { this.source = source; this._c = c; __super__.call(this); } SkipLastObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new SkipLastObserver(o, this._c)); }; return SkipLastObservable; }(ObservableBase)); var SkipLastObserver = (function (__super__) { inherits(SkipLastObserver, __super__); function SkipLastObserver(o, c) { this._o = o; this._c = c; this._q = []; __super__.call(this); } SkipLastObserver.prototype.next = function (x) { this._q.push(x); this._q.length > this._c && this._o.onNext(this._q.shift()); }; SkipLastObserver.prototype.error = function (e) { this._o.onError(e); }; SkipLastObserver.prototype.completed = function () { this._o.onCompleted(); }; return SkipLastObserver; }(AbstractObserver)); /** * Bypasses a specified number of elements at the end of an observable sequence. * @description * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed. * @param count Number of elements to bypass at the end of the source sequence. * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end. */ observableProto.skipLast = function (count) { if (count < 0) { throw new ArgumentOutOfRangeError(); } return new SkipLastObservable(this, count); }; /** * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend. * @example * var res = source.startWith(1, 2, 3); * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3); * @param {Arguments} args The specified values to prepend to the observable sequence * @returns {Observable} The source sequence prepended with the specified values. */ observableProto.startWith = function () { var values, scheduler, start = 0; if (!!arguments.length && isScheduler(arguments[0])) { scheduler = arguments[0]; start = 1; } else { scheduler = immediateScheduler; } for(var args = [], i = start, len = arguments.length; i < len; i++) { args.push(arguments[i]); } return observableConcat.apply(null, [observableFromArray(args, scheduler), this]); }; var TakeLastObserver = (function (__super__) { inherits(TakeLastObserver, __super__); function TakeLastObserver(o, c) { this._o = o; this._c = c; this._q = []; __super__.call(this); } TakeLastObserver.prototype.next = function (x) { this._q.push(x); this._q.length > this._c && this._q.shift(); }; TakeLastObserver.prototype.error = function (e) { this._o.onError(e); }; TakeLastObserver.prototype.completed = function () { while (this._q.length > 0) { this._o.onNext(this._q.shift()); } this._o.onCompleted(); }; return TakeLastObserver; }(AbstractObserver)); /** * Returns a specified number of contiguous elements from the end of an observable sequence. * @description * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence. */ observableProto.takeLast = function (count) { if (count < 0) { throw new ArgumentOutOfRangeError(); } var source = this; return new AnonymousObservable(function (o) { return source.subscribe(new TakeLastObserver(o, count)); }, source); }; var TakeLastBufferObserver = (function (__super__) { inherits(TakeLastBufferObserver, __super__); function TakeLastBufferObserver(o, c) { this._o = o; this._c = c; this._q = []; __super__.call(this); } TakeLastBufferObserver.prototype.next = function (x) { this._q.push(x); this._q.length > this._c && this._q.shift(); }; TakeLastBufferObserver.prototype.error = function (e) { this._o.onError(e); }; TakeLastBufferObserver.prototype.completed = function () { this._o.onNext(this._q); this._o.onCompleted(); }; return TakeLastBufferObserver; }(AbstractObserver)); /** * Returns an array with the specified number of contiguous elements from the end of an observable sequence. * * @description * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the * source sequence, this buffer is produced on the result sequence. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence. */ observableProto.takeLastBuffer = function (count) { if (count < 0) { throw new ArgumentOutOfRangeError(); } var source = this; return new AnonymousObservable(function (o) { return source.subscribe(new TakeLastBufferObserver(o, count)); }, source); }; /** * Projects each element of an observable sequence into zero or more windows which are produced based on element count information. * @param {Number} count Length of each window. * @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count. * @returns {Observable} An observable sequence of windows. */ observableProto.windowWithCount = observableProto.windowCount = function (count, skip) { var source = this; +count || (count = 0); Math.abs(count) === Infinity && (count = 0); if (count <= 0) { throw new ArgumentOutOfRangeError(); } skip == null && (skip = count); +skip || (skip = 0); Math.abs(skip) === Infinity && (skip = 0); if (skip <= 0) { throw new ArgumentOutOfRangeError(); } return new AnonymousObservable(function (observer) { var m = new SingleAssignmentDisposable(), refCountDisposable = new RefCountDisposable(m), n = 0, q = []; function createWindow () { var s = new Subject(); q.push(s); observer.onNext(addRef(s, refCountDisposable)); } createWindow(); m.setDisposable(source.subscribe( function (x) { for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); } var c = n - count + 1; c >= 0 && c % skip === 0 && q.shift().onCompleted(); ++n % skip === 0 && createWindow(); }, function (e) { while (q.length > 0) { q.shift().onError(e); } observer.onError(e); }, function () { while (q.length > 0) { q.shift().onCompleted(); } observer.onCompleted(); } )); return refCountDisposable; }, source); }; observableProto.flatMapConcat = observableProto.concatMap = function(selector, resultSelector, thisArg) { return new FlatMapObservable(this, selector, resultSelector, thisArg).merge(1); }; /** * Projects each notification of an observable sequence to an observable sequence and concats the resulting observable sequences into one observable sequence. * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element. * @param {Function} onError A transform function to apply when an error occurs in the source sequence. * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached. * @param {Any} [thisArg] An optional "this" to use to invoke each transform. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence. */ observableProto.concatMapObserver = observableProto.selectConcatObserver = function(onNext, onError, onCompleted, thisArg) { var source = this, onNextFunc = bindCallback(onNext, thisArg, 2), onErrorFunc = bindCallback(onError, thisArg, 1), onCompletedFunc = bindCallback(onCompleted, thisArg, 0); return new AnonymousObservable(function (observer) { var index = 0; return source.subscribe( function (x) { var result; try { result = onNextFunc(x, index++); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); }, function (err) { var result; try { result = onErrorFunc(err); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }, function () { var result; try { result = onCompletedFunc(); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }); }, this).concatAll(); }; var DefaultIfEmptyObserver = (function (__super__) { inherits(DefaultIfEmptyObserver, __super__); function DefaultIfEmptyObserver(o, d) { this._o = o; this._d = d; this._f = false; __super__.call(this); } DefaultIfEmptyObserver.prototype.next = function (x) { this._f = true; this._o.onNext(x); }; DefaultIfEmptyObserver.prototype.error = function (e) { this._o.onError(e); }; DefaultIfEmptyObserver.prototype.completed = function () { !this._f && this._o.onNext(this._d); this._o.onCompleted(); }; return DefaultIfEmptyObserver; }(AbstractObserver)); /** * Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty. * * var res = obs = xs.defaultIfEmpty(); * 2 - obs = xs.defaultIfEmpty(false); * * @memberOf Observable# * @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null. * @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself. */ observableProto.defaultIfEmpty = function (defaultValue) { var source = this; defaultValue === undefined && (defaultValue = null); return new AnonymousObservable(function (o) { return source.subscribe(new DefaultIfEmptyObserver(o, defaultValue)); }, source); }; // Swap out for Array.findIndex function arrayIndexOfComparer(array, item, comparer) { for (var i = 0, len = array.length; i < len; i++) { if (comparer(array[i], item)) { return i; } } return -1; } function HashSet(comparer) { this.comparer = comparer; this.set = []; } HashSet.prototype.push = function(value) { var retValue = arrayIndexOfComparer(this.set, value, this.comparer) === -1; retValue && this.set.push(value); return retValue; }; var DistinctObservable = (function (__super__) { inherits(DistinctObservable, __super__); function DistinctObservable(source, keyFn, cmpFn) { this.source = source; this._keyFn = keyFn; this._cmpFn = cmpFn; __super__.call(this); } DistinctObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new DistinctObserver(o, this._keyFn, this._cmpFn)); }; return DistinctObservable; }(ObservableBase)); var DistinctObserver = (function (__super__) { inherits(DistinctObserver, __super__); function DistinctObserver(o, keyFn, cmpFn) { this._o = o; this._keyFn = keyFn; this._h = new HashSet(cmpFn); __super__.call(this); } DistinctObserver.prototype.next = function (x) { var key = x; if (isFunction(this._keyFn)) { key = tryCatch(this._keyFn)(x); if (key === errorObj) { return this._o.onError(key.e); } } this._h.push(key) && this._o.onNext(x); }; DistinctObserver.prototype.error = function (e) { this._o.onError(e); }; DistinctObserver.prototype.completed = function () { this._o.onCompleted(); }; return DistinctObserver; }(AbstractObserver)); /** * Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer. * Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large. * * @example * var res = obs = xs.distinct(); * 2 - obs = xs.distinct(function (x) { return x.id; }); * 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; }); * @param {Function} [keySelector] A function to compute the comparison key for each element. * @param {Function} [comparer] Used to compare items in the collection. * @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence. */ observableProto.distinct = function (keySelector, comparer) { comparer || (comparer = defaultComparer); return new DistinctObservable(this, keySelector, comparer); }; /** * Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function. * * @example * var res = observable.groupBy(function (x) { return x.id; }); * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }); * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); }); * @param {Function} keySelector A function to extract the key for each element. * @param {Function} [elementSelector] A function to map each source element to an element in an observable group. * @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. */ observableProto.groupBy = function (keySelector, elementSelector) { return this.groupByUntil(keySelector, elementSelector, observableNever); }; /** * Groups the elements of an observable sequence according to a specified key selector function. * A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same * key value as a reclaimed group occurs, the group will be reborn with a new lifetime request. * * @example * var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); }); * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }); * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); }); * @param {Function} keySelector A function to extract the key for each element. * @param {Function} durationSelector A function to signal the expiration of a group. * @returns {Observable} * A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. * If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered. * */ observableProto.groupByUntil = function (keySelector, elementSelector, durationSelector) { var source = this; return new AnonymousObservable(function (o) { var map = new Map(), groupDisposable = new CompositeDisposable(), refCountDisposable = new RefCountDisposable(groupDisposable), handleError = function (e) { return function (item) { item.onError(e); }; }; groupDisposable.add( source.subscribe(function (x) { var key = tryCatch(keySelector)(x); if (key === errorObj) { map.forEach(handleError(key.e)); return o.onError(key.e); } var fireNewMapEntry = false, writer = map.get(key); if (writer === undefined) { writer = new Subject(); map.set(key, writer); fireNewMapEntry = true; } if (fireNewMapEntry) { var group = new GroupedObservable(key, writer, refCountDisposable), durationGroup = new GroupedObservable(key, writer); var duration = tryCatch(durationSelector)(durationGroup); if (duration === errorObj) { map.forEach(handleError(duration.e)); return o.onError(duration.e); } o.onNext(group); var md = new SingleAssignmentDisposable(); groupDisposable.add(md); md.setDisposable(duration.take(1).subscribe( noop, function (e) { map.forEach(handleError(e)); o.onError(e); }, function () { if (map['delete'](key)) { writer.onCompleted(); } groupDisposable.remove(md); })); } var element = x; if (isFunction(elementSelector)) { element = tryCatch(elementSelector)(x); if (element === errorObj) { map.forEach(handleError(element.e)); return o.onError(element.e); } } writer.onNext(element); }, function (e) { map.forEach(handleError(e)); o.onError(e); }, function () { map.forEach(function (item) { item.onCompleted(); }); o.onCompleted(); })); return refCountDisposable; }, source); }; var MapObservable = (function (__super__) { inherits(MapObservable, __super__); function MapObservable(source, selector, thisArg) { this.source = source; this.selector = bindCallback(selector, thisArg, 3); __super__.call(this); } function innerMap(selector, self) { return function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); }; } MapObservable.prototype.internalMap = function (selector, thisArg) { return new MapObservable(this.source, innerMap(selector, this), thisArg); }; MapObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new InnerObserver(o, this.selector, this)); }; inherits(InnerObserver, AbstractObserver); function InnerObserver(o, selector, source) { this.o = o; this.selector = selector; this.source = source; this.i = 0; AbstractObserver.call(this); } InnerObserver.prototype.next = function(x) { var result = tryCatch(this.selector)(x, this.i++, this.source); if (result === errorObj) { return this.o.onError(result.e); } this.o.onNext(result); }; InnerObserver.prototype.error = function (e) { this.o.onError(e); }; InnerObserver.prototype.completed = function () { this.o.onCompleted(); }; return MapObservable; }(ObservableBase)); /** * Projects each element of an observable sequence into a new form by incorporating the element's index. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source. */ observableProto.map = observableProto.select = function (selector, thisArg) { var selectorFn = typeof selector === 'function' ? selector : function () { return selector; }; return this instanceof MapObservable ? this.internalMap(selectorFn, thisArg) : new MapObservable(this, selectorFn, thisArg); }; function plucker(args, len) { return function mapper(x) { var currentProp = x; for (var i = 0; i < len; i++) { var p = currentProp[args[i]]; if (typeof p !== 'undefined') { currentProp = p; } else { return undefined; } } return currentProp; }; } /** * Retrieves the value of a specified nested property from all elements in * the Observable sequence. * @param {Arguments} arguments The nested properties to pluck. * @returns {Observable} Returns a new Observable sequence of property values. */ observableProto.pluck = function () { var len = arguments.length, args = new Array(len); if (len === 0) { throw new Error('List of properties cannot be empty.'); } for(var i = 0; i < len; i++) { args[i] = arguments[i]; } return this.map(plucker(args, len)); }; observableProto.flatMap = observableProto.selectMany = observableProto.mergeMap = function(selector, resultSelector, thisArg) { return new FlatMapObservable(this, selector, resultSelector, thisArg).mergeAll(); }; /** * Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element. * @param {Function} onError A transform function to apply when an error occurs in the source sequence. * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached. * @param {Any} [thisArg] An optional "this" to use to invoke each transform. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence. */ observableProto.flatMapObserver = observableProto.selectManyObserver = function (onNext, onError, onCompleted, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var index = 0; return source.subscribe( function (x) { var result; try { result = onNext.call(thisArg, x, index++); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); }, function (err) { var result; try { result = onError.call(thisArg, err); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }, function () { var result; try { result = onCompleted.call(thisArg); } catch (e) { observer.onError(e); return; } isPromise(result) && (result = observableFromPromise(result)); observer.onNext(result); observer.onCompleted(); }); }, source).mergeAll(); }; observableProto.flatMapLatest = observableProto.switchMap = function(selector, resultSelector, thisArg) { return new FlatMapObservable(this, selector, resultSelector, thisArg).switchLatest(); }; var SkipObservable = (function(__super__) { inherits(SkipObservable, __super__); function SkipObservable(source, count) { this.source = source; this._count = count; __super__.call(this); } SkipObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new SkipObserver(o, this._count)); }; function SkipObserver(o, c) { this._o = o; this._r = c; AbstractObserver.call(this); } inherits(SkipObserver, AbstractObserver); SkipObserver.prototype.next = function (x) { if (this._r <= 0) { this._o.onNext(x); } else { this._r--; } }; SkipObserver.prototype.error = function(e) { this._o.onError(e); }; SkipObserver.prototype.completed = function() { this._o.onCompleted(); }; return SkipObservable; }(ObservableBase)); /** * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. * @param {Number} count The number of elements to skip before returning the remaining elements. * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence. */ observableProto.skip = function (count) { if (count < 0) { throw new ArgumentOutOfRangeError(); } return new SkipObservable(this, count); }; var SkipWhileObservable = (function (__super__) { inherits(SkipWhileObservable, __super__); function SkipWhileObservable(source, fn) { this.source = source; this._fn = fn; __super__.call(this); } SkipWhileObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new SkipWhileObserver(o, this)); }; return SkipWhileObservable; }(ObservableBase)); var SkipWhileObserver = (function (__super__) { inherits(SkipWhileObserver, __super__); function SkipWhileObserver(o, p) { this._o = o; this._p = p; this._i = 0; this._r = false; __super__.call(this); } SkipWhileObserver.prototype.next = function (x) { if (!this._r) { var res = tryCatch(this._p._fn)(x, this._i++, this._p); if (res === errorObj) { return this._o.onError(res.e); } this._r = !res; } this._r && this._o.onNext(x); }; SkipWhileObserver.prototype.error = function (e) { this._o.onError(e); }; SkipWhileObserver.prototype.completed = function () { this._o.onCompleted(); }; return SkipWhileObserver; }(AbstractObserver)); /** * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. * The element's index is used in the logic of the predicate function. * * var res = source.skipWhile(function (value) { return value < 10; }); * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. */ observableProto.skipWhile = function (predicate, thisArg) { var fn = bindCallback(predicate, thisArg, 3); return new SkipWhileObservable(this, fn); }; var TakeObservable = (function(__super__) { inherits(TakeObservable, __super__); function TakeObservable(source, count) { this.source = source; this._count = count; __super__.call(this); } TakeObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new TakeObserver(o, this._count)); }; function TakeObserver(o, c) { this._o = o; this._c = c; this._r = c; AbstractObserver.call(this); } inherits(TakeObserver, AbstractObserver); TakeObserver.prototype.next = function (x) { if (this._r-- > 0) { this._o.onNext(x); this._r <= 0 && this._o.onCompleted(); } }; TakeObserver.prototype.error = function (e) { this._o.onError(e); }; TakeObserver.prototype.completed = function () { this._o.onCompleted(); }; return TakeObservable; }(ObservableBase)); /** * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0). * @param {Number} count The number of elements to return. * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case