BACK
PracticeInterview: mergeWith() action streams
PRACTICE · 46 · 練

Interview: mergeWith() action streams

Merge the manual action with the auto action using mergeWith.

  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, mergeWith } = Rx;

const manual$ = of('manual');
const auto$ = of('auto');

const result$ = manual$.pipe(
  mergeWith(auto$)
);

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