| 310 | }; |
| 311 | |
| 312 | private notifyGot(key: IPublicTypeEditorValueKey) { |
| 313 | let waits = this.waits.get(key); |
| 314 | if (!waits) { |
| 315 | return; |
| 316 | } |
| 317 | waits = waits.slice().reverse(); |
| 318 | let i = waits.length; |
| 319 | while (i--) { |
| 320 | waits[i].resolve(this.get(key)); |
| 321 | if (waits[i].once) { |
| 322 | waits.splice(i, 1); |
| 323 | } |
| 324 | } |
| 325 | if (waits.length > 0) { |
| 326 | this.waits.set(key, waits); |
| 327 | } else { |
| 328 | this.waits.delete(key); |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | private setWait(key: IPublicTypeEditorValueKey, resolve: (data: any) => void, once?: boolean) { |
| 333 | const waits = this.waits.get(key); |