BACK
PracticeInterview: sequenceEqual() protocol check
PRACTICE · 75 · 練

Interview: sequenceEqual() protocol check

Check that the actual protocol stream equals the expected one.

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

const actual$ = of('HELLO', 'ACK');
const expected$ = of('HELLO', 'ACK');

const result$ = actual$.pipe(
  sequenceEqual(expected$)
);

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