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