BACK
PracticeReal-life: combineLatest() form filters
PRACTICE · 21 · 練

Real-life: combineLatest() form filters

Combine query and page to produce the string rxjs@2.

  1. Solve the task in the editor — no long theory.
  2. Run the check and compare your output with the expected result.
  3. Stuck? Open the solution and carry the approach into your own code.
Solution spoiler · click to reveal
const { of, combineLatest, map } = Rx;

const query$ = of('rxjs');
const page$ = of(2);

const result$ = combineLatest([query$, page$]).pipe(
  map(([query, page]) => query + '@' + page)
);

result$.subscribe(value => console.log(value));
script.ts // TypeScript
CONSOLE · Console output
Hit Run to see the result...