RxJS. Delay from array
import { of, from } from 'rxjs';
import { map, concatMap, delay } from 'rxjs/operators';
from([2,4,6,8]).pipe(
concatMap(item => of(item).pipe(delay(1000)))
).subscribe(console.log); Stackblitz (in console):
import { of, from } from 'rxjs';
import { map, concatMap, delay } from 'rxjs/operators';
from([2,4,6,8]).pipe(
concatMap(item => of(item).pipe(delay(1000)))
).subscribe(console.log); Stackblitz (in console):
$ Выдержки из доклада Андрея Алексеева (Tinkoff) про RxJs (Subject, Behaviour Subject, Replay Subject, Async Subject). Применение в Angular.
Немного поясненительных примеров о Pick и Record
Array.from({ length: 7 }, (_, index) => new Date().getFullYear() - index);