项目原始demo,不改动
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。
 
 
 
 

26 行
860 B

  1. import { Observable } from '../Observable';
  2. /**
  3. * Collects all source emissions and emits them as an array when the source completes.
  4. *
  5. * <span class="informal">Get all values inside an array when the source completes</span>
  6. *
  7. * <img src="./img/toArray.png" width="100%">
  8. *
  9. * `toArray` will wait until the source Observable completes
  10. * before emitting the array containing all emissions.
  11. * When the source Observable errors no array will be emitted.
  12. *
  13. * @example <caption>Create array from input</caption>
  14. * const input = Rx.Observable.interval(100).take(4);
  15. *
  16. * input.toArray()
  17. * .subscribe(arr => console.log(arr)); // [0,1,2,3]
  18. *
  19. * @see {@link buffer}
  20. *
  21. * @return {Observable<any[]>|WebSocketSubject<T>|Observable<T>}
  22. * @method toArray
  23. * @owner Observable
  24. */
  25. export declare function toArray<T>(this: Observable<T>): Observable<T[]>;