(fn: (store: DisposableStore) => void)
| 213 | } |
| 214 | |
| 215 | export function disposeOnReturn(fn: (store: DisposableStore) => void): void { |
| 216 | const store = new DisposableStore(); |
| 217 | try { |
| 218 | fn(store); |
| 219 | } finally { |
| 220 | store.dispose(); |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | /** |
| 225 | * A map the manages the lifecycle of the values that it stores. |