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.
О том как не надо и как надо делать подписки в rxjs
Загрузка изображения вне DOM с последующей подменой
Array.from({ length: 7 }, (_, index) => new Date().getFullYear() - index);