Exercise
- Open exercise on codesandbox.
- Create a new higher-order function named
verifyPasscode. The first argument is thepasscodethat is an array ofnumbervalues. The second argument is optional, and is thetimeoutthat defaults to 1000 milliseconds. - Return a function that accepts the
sourceObservable - Return the
sourceObservable, and within thepipe()method use thewindowoperator to open a window that will be closed when thesourceObservable 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.