File size: 351 Bytes
4327358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Subject } from 'rxjs';

interface WithValues<T> {
  values(): IterableIterator<T>;
}

interface Completable {
  complete(): void;
}

/**
 * Go over collection and complete each item
 * @param collection
 */
export function complete(collection: WithValues<Completable>) {
  for (const item of collection.values()) {
    item.complete();
  }
}