function
stable
Converts the arguments to an observable sequence.
of<T>(...args: Array<T | SchedulerLike>): Observable<T>
args | Type: |
Observable<T>
: An Observable that emits the arguments described above and then completes.
Each argument becomes a next
notification.
Unlike from
, it does not do any flattening and emits each argument in whole as a separate next
notification.
Emit the values 10, 20, 30
import { of } from 'rxjs'; of(10, 20, 30) .subscribe( next => console.log('next:', next), err => console.log('error:', err), () => console.log('the end'), ); // result: // 'next: 10' // 'next: 20' // 'next: 30'
Emit the array [1,2,3]
import { of } from 'rxjs'; of([1,2,3]) .subscribe( next => console.log('next:', next), err => console.log('error:', err), () => console.log('the end'), ); // result: // 'next: [1,2,3]'
of(a: T, scheduler: SchedulerLike): Observable<T>
a | Type: |
scheduler | Type: |
Observable<T>
of(a: T, b: T2, scheduler: SchedulerLike): Observable<T | T2>
a | Type: |
b | Type: |
scheduler | Type: |
Observable<T | T2>
of(a: T, b: T2, c: T3, scheduler: SchedulerLike): Observable<T | T2 | T3>
a | Type: |
b | Type: |
c | Type: |
scheduler | Type: |
Observable<T | T2 | T3>
of(a: T, b: T2, c: T3, d: T4, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4>
a | Type: |
b | Type: |
c | Type: |
d | Type: |
scheduler | Type: |
Observable<T | T2 | T3 | T4>
of(a: T, b: T2, c: T3, d: T4, e: T5, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5>
a | Type: |
b | Type: |
c | Type: |
d | Type: |
e | Type: |
scheduler | Type: |
Observable<T | T2 | T3 | T4 | T5>
of(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6>
a | Type: |
b | Type: |
c | Type: |
d | Type: |
e | Type: |
f | Type: |
scheduler | Type: |
Observable<T | T2 | T3 | T4 | T5 | T6>
of(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6 | T7>
a | Type: |
b | Type: |
c | Type: |
d | Type: |
e | Type: |
f | Type: |
g | Type: |
scheduler | Type: |
Observable<T | T2 | T3 | T4 | T5 | T6 | T7>
of(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8>
a | Type: |
b | Type: |
c | Type: |
d | Type: |
e | Type: |
f | Type: |
g | Type: |
h | Type: |
scheduler | Type: |
Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8>
of(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8, i: T9, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9>
a | Type: |
b | Type: |
c | Type: |
d | Type: |
e | Type: |
f | Type: |
g | Type: |
h | Type: |
i | Type: |
scheduler | Type: |
Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9>
of(...args: (T | SchedulerLike)[]): Observable<T>
args | Type: |
Observable<T>
of(a: T): Observable<T>
a | Type: |
Observable<T>
of(a: T, b: T2): Observable<T | T2>
a | Type: |
b | Type: |
Observable<T | T2>
of(a: T, b: T2, c: T3): Observable<T | T2 | T3>
a | Type: |
b | Type: |
c | Type: |
Observable<T | T2 | T3>
of(a: T, b: T2, c: T3, d: T4): Observable<T | T2 | T3 | T4>
a | Type: |
b | Type: |
c | Type: |
d | Type: |
Observable<T | T2 | T3 | T4>
of(a: T, b: T2, c: T3, d: T4, e: T5): Observable<T | T2 | T3 | T4 | T5>
a | Type: |
b | Type: |
c | Type: |
d | Type: |
e | Type: |
Observable<T | T2 | T3 | T4 | T5>
of(a: T, b: T2, c: T3, d: T4, e: T5, f: T6): Observable<T | T2 | T3 | T4 | T5 | T6>
a | Type: |
b | Type: |
c | Type: |
d | Type: |
e | Type: |
f | Type: |
Observable<T | T2 | T3 | T4 | T5 | T6>
of(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7): Observable<T | T2 | T3 | T4 | T5 | T6 | T7>
a | Type: |
b | Type: |
c | Type: |
d | Type: |
e | Type: |
f | Type: |
g | Type: |
Observable<T | T2 | T3 | T4 | T5 | T6 | T7>
of(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8): Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8>
a | Type: |
b | Type: |
c | Type: |
d | Type: |
e | Type: |
f | Type: |
g | Type: |
h | Type: |
Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8>
of(a: T, b: T2, c: T3, d: T4, e: T5, f: T6, g: T7, h: T8, i: T9): Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9>
a | Type: |
b | Type: |
c | Type: |
d | Type: |
e | Type: |
f | Type: |
g | Type: |
h | Type: |
i | Type: |
Observable<T | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9>
of(...args: T[]): Observable<T>
args | Type: |
Observable<T>
© 2015–2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors.
Code licensed under an Apache-2.0 License. Documentation licensed under CC BY 4.0.
https://rxjs.dev/api/index/function/of