Last active
February 9, 2019 07:24
-
-
Save cartant/78d47d52e4ca53038a755eb48152712f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { defer, MonoTypeOperatorFunction } from "rxjs"; | |
| import { tap } from "rxjs/operators"; | |
| export function debug<T>(): MonoTypeOperatorFunction<T> { | |
| return source => defer(() => { | |
| let index = -1; | |
| return source.pipe( | |
| tap(t => console.log(`[${++index}]: ${t}`)) | |
| ); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment