()
| 79 | let hasResolved = false; |
| 80 | |
| 81 | function resolveOnce(): void { |
| 82 | if (!hasResolved) { |
| 83 | hasResolved = true; |
| 84 | resolve(stream); |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | // Track the abort listener so it can be removed if the Observable completes (as a memory |
| 89 | // optimization). |