LiveLoveApp logo

Exercise - Higher-order Function Operator

Exercise

  1. Open exercise on codesandbox.
  2. Create a new higher-order function named verifyPasscode. The first argument is the passcode that is an array of number values. The second argument is optional, and is the timeout that defaults to 1000 milliseconds.
  3. Return a function that accepts the source Observable
  4. Return the source Observable, and within the pipe() method use the window operator to open a window that will be closed when the source Observable emits a next notification. Use the debounceTime() operator to debounce values from the source Observable for the specified timeout.
  5. Use the mergeMap() operator to validate the next notification values emitted by the Observable that the window() operator creates.