Skip to content

Instantly share code, notes, and snippets.

@dmorosinotto
Forked from NetanelBasal/rxjs-log-operator.ts
Created April 2, 2019 02:35
Show Gist options
  • Save dmorosinotto/ee52570db39606e31fbc794bbe9e9dbb to your computer and use it in GitHub Desktop.
Save dmorosinotto/ee52570db39606e31fbc794bbe9e9dbb to your computer and use it in GitHub Desktop.
const log = (tag: string) => tap(
next => console.log(`%c[${tag}: Next]`, 'color: #4CAF50;', next),
error => console.log(`%c${tag}: Error]`, 'color: #F44336;', error),
() => console.log(`%c[${tag}: Complete]`, 'color: #2196F3;')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment