1.5.0 • Published 4 years ago
@ndct/rxjs-operators v1.5.0
rxjs-operators
Rxjs 操作符扩展
安装
npm install @ndct/rxjs-operators
操作符
start
在订阅时执行副作用
start<T>(callback: () => any): MonoTypeOperatorFunction<T>
参数
名称 说明 callback 订阅时要调用的函数 示例
ajax(`https://api.github.com/users?per_page=5`) .pipe( start(() => (this.loading = true)), finalize(() => (this.loading = false)) ) .subscribe();