()
| 70 | let hasResolved = false; |
| 71 | |
| 72 | function resolveOnce(): void { |
| 73 | if (!hasResolved) { |
| 74 | hasResolved = true; |
| 75 | resolve(stream); |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | // Track the abort listener so it can be removed if the Observable completes (as a memory |
| 80 | // optimization). |