startWith
signature: startWith(an: Values): Observable
startWith(an: Values): Observable주어진 값을 처음으로 방출합니다.
예시
// RxJS v6+
import { startWith } from 'rxjs/operators';
import { of } from 'rxjs';
//방출 (1,2,3)
const source = of(1, 2, 3);
// 0부터 시작
const example = source.pipe(startWith(0));
//결과: 0,1,2,3
const subscribe = example.subscribe(val => console.log(val));관련한 사용법
추가 자료
Last updated
Was this helpful?