View iterator.ts
1 2 3 4 5 6 7 8 9 10
interface Iterable<T> {
[Symbol.iterator]() : Iterator<T>
}
 
interface Iterator<T> {
[Symbol.iterator]() : Iterator<T>
next() : IteratorResult<T>
}
 
interface IteratorResult<T> {
View rx.js
1 2 3 4 5 6 7 8 9 10
var Observable = require('rx.observable');
var map = require('rx.observable.map');
 
Observable.prototype.map = function (selector, thisArg) {
return map(this, selector, thisArg);
}
 
module.exports = {
Observable: Observable
};
View totask.cs
1 2 3 4 5 6 7 8 9 10
/// <summary>
/// Returns a task that will receive the last value or the exception produced by the observable sequence.
/// </summary>
/// <typeparam name="TResult">The type of the elements in the source sequence.</typeparam>
/// <param name="observable">Observable sequence to convert to a task.</param>
/// <param name="cancellationToken">Cancellation token that can be used to cancel the task, causing unsubscription from the observable sequence.</param>
/// <param name="state">The state to use as the underlying task's AsyncState.</param>
/// <returns>A task that will receive the last element or the exception produced by the observable sequence.</returns>
/// <exception cref="ArgumentNullException"><paramref name="observable"/> is null.</exception>
public static Task<IEnumerable<TResult>> ToTask<TResult>(this IObservable<TResult> observable, CancellationToken cancellationToken, object state)
View foo.cs
1 2 3 4 5 6 7 8 9 10
Enumerable.Range(1, 4).ToObservable()
.GroupBy(x => x % 3)
.Concat()
.Subscribe(Console.WriteLine);
// => 1
// => 4
Enumerable.Range(1, 4).ToObservable()
.GroupBy(x => x % 3)
.Merge()
.Subscribe(Console.WriteLine);
View mapping-subject.js
1 2 3 4 5 6 7 8 9 10
// Create a single subject for all emitting of data
var subject = new Rx.Subject();
 
// Create something just for mapping
var obs = subject.map(function(message) {
return message + ' dawg.';
});
 
// Subscribe to that
obs.subscribe(function(message) {console.log(message);});
View asyncobservable.ts
1 2 3 4 5 6 7 8 9 10
interface Disposable {
dispose(): void
}
interface AsyncObservable<T> {
subscribe(observer: AsyncObserver<T>) : Disposable
// OR
forEach(observer: AsyncObserver<T>) : Disposable
}
View observable.ts
1 2 3 4 5 6 7 8 9
interface Disposable {
dispose(): void
}
 
interface Observable<T> {
subscribe(observer: Observer<T>) : Disposable
// OR
forEach(observer: Observer<T>) : Disposable
}
View stooges.md

Picking out some quotes to form a new language from Three Stooges WikiQuote inspired by Avail

  • Hello, Hello, Hello! Hello. - Main
  • Spread Out! - Process Fork
  • Soitenly! - True
  • Nyah - False
  • Why I Otta - Throw Error
  • This is all your fault you - Catch Error
  • I'm trying to think but nothing happens - Out of Memory Error
  • Nyuk Nyuk Nyuk - Return
View pluck.js
1 2 3 4 5 6 7 8 9 10
/**
* 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 args = arguments, len = arguments.length;
if (len === 0) { throw new Error('List of properties cannot be empty.'); }
return this.map(function (x) {
View selectmany.js
1 2 3 4 5 6 7 8 9 10
function flatMap(source, selector, thisArg) {
var selectorFn = isFunction(selector) ? bindCallback(selector, thisArg, 3) : function () { return selector; };
return new AnonymousObservable(function(observer) {
var sad = new SingleAssignmentDisposable();
var g = new CompositeDisposable();
g.add(sad);
var isStopped = false;
var i = 0;
sad.setDisposable(source.subscribe(
function (value) {
Something went wrong with that request. Please try again.