-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(compat): add Observable extension classes with static create()
- Loading branch information
Showing
48 changed files
with
270 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Observable, SchedulerLike, from } from 'rxjs'; | ||
|
||
export class ArrayLikeObservable<T> extends Observable<T> { | ||
static create<T>(arrayLike: ArrayLike<T>, scheduler?: SchedulerLike): Observable<T> { | ||
return from(arrayLike, scheduler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Observable, SchedulerLike, from } from 'rxjs'; | ||
|
||
export class ArrayObservable<T> extends Observable<T> { | ||
static create<T>(array: T[], scheduler?: SchedulerLike) { | ||
return from(array, scheduler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Observable, SchedulerLike, bindCallback } from 'rxjs'; | ||
|
||
export class BoundCallbackObservable<T> extends Observable<T> { | ||
/* tslint:disable:max-line-length */ | ||
static create(callbackFunc: (callback: () => any) => any, selector?: void, scheduler?: SchedulerLike): () => Observable<void>; | ||
static create<R>(callbackFunc: (callback: (result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): () => Observable<R>; | ||
static create<T, R>(callbackFunc: (v1: T, callback: (result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T) => Observable<R>; | ||
static create<T, T2, R>(callbackFunc: (v1: T, v2: T2, callback: (result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T, v2: T2) => Observable<R>; | ||
static create<T, T2, T3, R>(callbackFunc: (v1: T, v2: T2, v3: T3, callback: (result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3) => Observable<R>; | ||
static create<T, T2, T3, T4, R>(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, callback: (result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3, v4: T4) => Observable<R>; | ||
static create<T, T2, T3, T4, T5, R>(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, callback: (result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => Observable<R>; | ||
static create<T, T2, T3, T4, T5, T6, R>(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, callback: (result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => Observable<R>; | ||
static create<R>(callbackFunc: (callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: SchedulerLike): () => Observable<R>; | ||
static create<T, R>(callbackFunc: (v1: T, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: SchedulerLike): (v1: T) => Observable<R>; | ||
static create<T, T2, R>(callbackFunc: (v1: T, v2: T2, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: SchedulerLike): (v1: T, v2: T2) => Observable<R>; | ||
static create<T, T2, T3, R>(callbackFunc: (v1: T, v2: T2, v3: T3, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3) => Observable<R>; | ||
static create<T, T2, T3, T4, R>(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3, v4: T4) => Observable<R>; | ||
static create<T, T2, T3, T4, T5, R>(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => Observable<R>; | ||
static create<T, T2, T3, T4, T5, T6, R>(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, callback: (...args: any[]) => any) => any, selector: (...args: any[]) => R, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => Observable<R>; | ||
static create<T>(callbackFunc: Function, selector?: void, scheduler?: SchedulerLike): (...args: any[]) => Observable<T>; | ||
static create<T>(callbackFunc: Function, selector?: (...args: any[]) => T, scheduler?: SchedulerLike): (...args: any[]) => Observable<T>; | ||
/* tslint:enable:max-line-length */ | ||
static create<T>(func: Function, | ||
selector: Function | void = undefined, | ||
scheduler?: SchedulerLike): (...args: any[]) => Observable<T> { | ||
return bindCallback(func, <any>selector, scheduler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Observable, SchedulerLike, bindNodeCallback } from 'rxjs'; | ||
|
||
export class BoundNodeCallbackObservable<T> extends Observable<T> { | ||
/* tslint:disable:max-line-length */ | ||
static create<R>(callbackFunc: (callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): () => Observable<R>; | ||
static create<T, R>(callbackFunc: (v1: T, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T) => Observable<R>; | ||
static create<T, T2, R>(callbackFunc: (v1: T, v2: T2, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T, v2: T2) => Observable<R>; | ||
static create<T, T2, T3, R>(callbackFunc: (v1: T, v2: T2, v3: T3, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3) => Observable<R>; | ||
static create<T, T2, T3, T4, R>(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3, v4: T4) => Observable<R>; | ||
static create<T, T2, T3, T4, T5, R>(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => Observable<R>; | ||
static create<T, T2, T3, T4, T5, T6, R>(callbackFunc: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, callback: (err: any, result: R) => any) => any, selector?: void, scheduler?: SchedulerLike): (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => Observable<R>; | ||
static create<T>(callbackFunc: Function, selector?: void, scheduler?: SchedulerLike): (...args: any[]) => Observable<T>; | ||
static create<T>(callbackFunc: Function, selector?: (...args: any[]) => T, scheduler?: SchedulerLike): (...args: any[]) => Observable<T>; | ||
/* tslint:enable:max-line-length */ | ||
static create<T>(func: Function, | ||
selector: Function | void = undefined, | ||
scheduler?: SchedulerLike): (...args: any[]) => Observable<T> { | ||
return bindNodeCallback(func, <any>selector, scheduler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Observable, SubscribableOrPromise, defer } from 'rxjs'; | ||
|
||
export class DeferObservable<T> extends Observable<T> { | ||
static create<T>(observableFactory: () => SubscribableOrPromise<T> | void): Observable<T> { | ||
return defer(observableFactory); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Observable, SchedulerLike, empty } from 'rxjs'; | ||
|
||
export class EmptyObservable<T> extends Observable<T> { | ||
static create<T>(scheduler?: SchedulerLike): Observable<T> { | ||
return empty(scheduler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Observable, SchedulerLike, throwError } from 'rxjs'; | ||
|
||
export class ErrorObservable<T> extends Observable<T> { | ||
static create<T>(error: any, scheduler?: SchedulerLike) { | ||
return throwError(error, scheduler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Observable, SubscribableOrPromise, forkJoin } from 'rxjs'; | ||
|
||
export class ForkJoinObservable<T> extends Observable<T> { | ||
/* tslint:disable:max-line-length */ | ||
static create<T, T2>(v1: SubscribableOrPromise<T>, v2: SubscribableOrPromise<T2>): Observable<[T, T2]>; | ||
static create<T, T2, T3>(v1: SubscribableOrPromise<T>, v2: SubscribableOrPromise<T2>, v3: SubscribableOrPromise<T3>): Observable<[T, T2, T3]>; | ||
static create<T, T2, T3, T4>(v1: SubscribableOrPromise<T>, v2: SubscribableOrPromise<T2>, v3: SubscribableOrPromise<T3>, v4: SubscribableOrPromise<T4>): Observable<[T, T2, T3, T4]>; | ||
static create<T, T2, T3, T4, T5>(v1: SubscribableOrPromise<T>, v2: SubscribableOrPromise<T2>, v3: SubscribableOrPromise<T3>, v4: SubscribableOrPromise<T4>, v5: SubscribableOrPromise<T5>): Observable<[T, T2, T3, T4, T5]>; | ||
static create<T, T2, T3, T4, T5, T6>(v1: SubscribableOrPromise<T>, v2: SubscribableOrPromise<T2>, v3: SubscribableOrPromise<T3>, v4: SubscribableOrPromise<T4>, v5: SubscribableOrPromise<T5>, v6: SubscribableOrPromise<T6>): Observable<[T, T2, T3, T4, T5, T6]>; | ||
static create<T, R>(v1: SubscribableOrPromise<T>, project: (v1: T) => R): Observable<R>; | ||
static create<T, T2, R>(v1: SubscribableOrPromise<T>, v2: SubscribableOrPromise<T2>, project: (v1: T, v2: T2) => R): Observable<R>; | ||
static create<T, T2, T3, R>(v1: SubscribableOrPromise<T>, v2: SubscribableOrPromise<T2>, v3: SubscribableOrPromise<T3>, project: (v1: T, v2: T2, v3: T3) => R): Observable<R>; | ||
static create<T, T2, T3, T4, R>(v1: SubscribableOrPromise<T>, v2: SubscribableOrPromise<T2>, v3: SubscribableOrPromise<T3>, v4: SubscribableOrPromise<T4>, project: (v1: T, v2: T2, v3: T3, v4: T4) => R): Observable<R>; | ||
static create<T, T2, T3, T4, T5, R>(v1: SubscribableOrPromise<T>, v2: SubscribableOrPromise<T2>, v3: SubscribableOrPromise<T3>, v4: SubscribableOrPromise<T4>, v5: SubscribableOrPromise<T5>, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => R): Observable<R>; | ||
static create<T, T2, T3, T4, T5, T6, R>(v1: SubscribableOrPromise<T>, v2: SubscribableOrPromise<T2>, v3: SubscribableOrPromise<T3>, v4: SubscribableOrPromise<T4>, v5: SubscribableOrPromise<T5>, v6: SubscribableOrPromise<T6>, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => R): Observable<R>; | ||
static create<T>(sources: SubscribableOrPromise<T>[]): Observable<T[]>; | ||
static create<R>(sources: SubscribableOrPromise<any>[]): Observable<R>; | ||
static create<T, R>(sources: SubscribableOrPromise<T>[], project: (...values: Array<T>) => R): Observable<R>; | ||
static create<R>(sources: SubscribableOrPromise<any>[], project: (...values: Array<any>) => R): Observable<R>; | ||
static create<T>(...sources: SubscribableOrPromise<T>[]): Observable<T[]>; | ||
static create<R>(...sources: SubscribableOrPromise<any>[]): Observable<R>; | ||
/* tslint:enable:max-line-length */ | ||
|
||
static create<T>(...sources: Array<SubscribableOrPromise<any> | | ||
Array<SubscribableOrPromise<any>> | | ||
((...values: Array<any>) => any)>): Observable<T> { | ||
return forkJoin(...sources); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Observable, fromEvent } from 'rxjs'; | ||
import { EventTargetLike } from 'rxjs/internal-compatibility'; | ||
|
||
export class FromEventObservable<T> extends Observable<T> { | ||
/* tslint:disable:max-line-length */ | ||
static create<T>(target: EventTargetLike, eventName: string): Observable<T>; | ||
static create<T>(target: EventTargetLike, eventName: string, selector: ((...args: any[]) => T)): Observable<T>; | ||
static create<T>(target: EventTargetLike, eventName: string, options: EventListenerOptions): Observable<T>; | ||
static create<T>(target: EventTargetLike, eventName: string, options: EventListenerOptions, selector: ((...args: any[]) => T)): Observable<T>; | ||
/* tslint:enable:max-line-length */ | ||
|
||
static create<T>(target: EventTargetLike, | ||
eventName: string, | ||
options?: EventListenerOptions | ((...args: any[]) => T), | ||
selector?: ((...args: any[]) => T)): Observable<T> { | ||
return fromEvent(target, eventName, options as EventListenerOptions, selector); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Observable, fromEventPattern } from 'rxjs'; | ||
|
||
export class FromEventPatternObservable<T> extends Observable<T> { | ||
static create<T>(addHandler: (handler: Function) => any, | ||
removeHandler?: (handler: Function, signal?: any) => void, | ||
selector?: (...args: Array<any>) => T) { | ||
return fromEventPattern(addHandler, removeHandler, selector); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Observable, ObservableInput, SchedulerLike, from } from 'rxjs'; | ||
|
||
export class FromObservable<T> extends Observable<T> { | ||
static create<T>(ish: ObservableInput<T>, scheduler?: SchedulerLike): Observable<T>; | ||
static create<T, R>(ish: ArrayLike<T>, scheduler?: SchedulerLike): Observable<R>; | ||
static create<T>(ish: ObservableInput<T>, scheduler?: SchedulerLike): Observable<T> { | ||
return from(ish, scheduler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Observable, SchedulerLike, generate } from 'rxjs'; | ||
import { ConditionFunc, IterateFunc, ResultFunc, GenerateBaseOptions, GenerateOptions } from 'rxjs/internal-compatibility'; | ||
|
||
export class GenerateObservable<T> extends Observable<T> { | ||
/* tslint:disable:max-line-length */ | ||
static create<T, S>(initialState: S, condition: ConditionFunc<S>, iterate: IterateFunc<S>, resultSelector: ResultFunc<S, T>, scheduler?: SchedulerLike): Observable<T>; | ||
static create<S>(initialState: S, condition: ConditionFunc<S>, iterate: IterateFunc<S>, scheduler?: SchedulerLike): Observable<S>; | ||
static create<S>(options: GenerateBaseOptions<S>): Observable<S>; | ||
static create<T, S>(options: GenerateOptions<T, S>): Observable<T>; | ||
/* tslint:enable:max-line-length */ | ||
|
||
static create<T, S>(initialStateOrOptions: S | GenerateOptions<T, S>, | ||
condition?: ConditionFunc<S>, | ||
iterate?: IterateFunc<S>, | ||
resultSelectorOrObservable?: (ResultFunc<S, T>) | SchedulerLike, | ||
scheduler?: SchedulerLike): Observable<T> { | ||
return generate(<S>initialStateOrOptions, condition, iterate, <ResultFunc<S, T>>resultSelectorOrObservable, scheduler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Observable, SubscribableOrPromise, iif } from 'rxjs'; | ||
|
||
export class IfObservable<T> extends Observable<T> { | ||
static create<T, R>(condition: () => boolean | void, | ||
thenSource?: SubscribableOrPromise<T> | void, | ||
elseSource?: SubscribableOrPromise<R> | void): Observable<T|R> { | ||
return iif(<() => boolean>condition, <SubscribableOrPromise<T>>thenSource, <SubscribableOrPromise<R>>elseSource); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Observable, SchedulerLike, asyncScheduler, interval } from 'rxjs'; | ||
|
||
export class IntervalObservable<T> extends Observable<T> { | ||
static create(period: number = 0, | ||
scheduler: SchedulerLike = asyncScheduler): Observable<number> { | ||
return interval(period, scheduler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Observable, SchedulerLike, from } from 'rxjs'; | ||
|
||
export class IteratorObservable<T> extends Observable<T> { | ||
static create<T>(iterator: any, scheduler?: SchedulerLike) { | ||
return from<T>(iterator, scheduler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Observable, SchedulerLike, NEVER } from 'rxjs'; | ||
|
||
export class NeverObservable<T> extends Observable<T> { | ||
static create<T>() { | ||
return NEVER; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Observable, SchedulerLike, pairs } from 'rxjs'; | ||
|
||
export class PairsObservable<T> extends Observable<T> { | ||
static create<T>(obj: Object, scheduler?: SchedulerLike): Observable<(string | T)[]> { | ||
return pairs(obj, scheduler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Observable, SchedulerLike, from } from 'rxjs'; | ||
|
||
export class PromiseObservable<T> extends Observable<T> { | ||
static create<T>(promise: PromiseLike<T>, scheduler?: SchedulerLike): Observable<T> { | ||
return from(promise, scheduler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Observable, SchedulerLike, range } from 'rxjs'; | ||
|
||
export class RangeObservable<T> extends Observable<T> { | ||
static create(start: number = 0, | ||
count: number = 0, | ||
scheduler?: SchedulerLike): Observable<number> { | ||
return range(start, count, scheduler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Observable, SchedulerLike, of } from 'rxjs'; | ||
|
||
export class ScalarObservable<T> extends Observable<T> { | ||
static create<T>(value: T, scheduler?: SchedulerLike) { | ||
return arguments.length > 1 ? of(value, scheduler) : of(value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Observable, SchedulerLike, timer } from 'rxjs'; | ||
|
||
export class TimerObservable<T> extends Observable<T> { | ||
static create(initialDelay: number | Date = 0, | ||
period?: number | SchedulerLike, | ||
scheduler?: SchedulerLike): Observable<number> { | ||
return timer(initialDelay, period, scheduler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Observable, Unsubscribable, SubscribableOrPromise, using } from 'rxjs'; | ||
|
||
export class UsingObservable<T> extends Observable<T> { | ||
static create<T>(resourceFactory: () => Unsubscribable | void, | ||
observableFactory: (resource: Unsubscribable | void) => SubscribableOrPromise<T> | void): Observable<T> { | ||
return using(resourceFactory, observableFactory); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/ArrayLikeObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/ArrayObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/BoundCallbackObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/BoundNodeCallbackObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/DeferObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/EmptyObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/ErrorObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/ForkJoinObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/FromEventObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/FromEventPatternObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/FromObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/GenerateObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/IfObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/IntervalObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/IteratorObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/NeverObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/PairsObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/PromiseObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/RangeObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/ScalarObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/TimerObservable'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from 'rxjs-compat/observable/UsingObservable'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters