Exercise
- Open exercise on codesandbox.
- Create a new higher-order function named
verifyPasscode
. The first argument is thepasscode
that is an array ofnumber
values. The second argument is optional, and is thetimeout
that defaults to 1000 milliseconds. - Return a function that accepts the
source
Observable - Return the
source
Observable, and within thepipe()
method use thewindow
operator to open a window that will be closed when thesource
Observable emits a next notification. Use thedebounceTime()
operator to debounce values from the source Observable for the specifiedtimeout
. - Use the
mergeMap()
operator to validate the next notification values emitted by the Observable that thewindow()
operator creates.