标签:color error completed pes log prot ret logs mod
Observable.prototype.debug = function(message: any) { return this.do( (next) => { if(!environment.production) { console.log(message, next); } }, (err) => { if(!environment.production) { console.error(message, err) } }, () => { if(!environment.production) { console.info("Observable completed", message) } } ); }; declare module ‘rxjs/observable‘ { interface Observable<T> { debug: (...any) => Observable<T> } }
[RxJS] Add debug method to Observable in TypeScript
标签:color error completed pes log prot ret logs mod
原文地址:http://www.cnblogs.com/Answer1215/p/6349762.html