(options: ResourceOptions<T, R>)
| 543 | } |
| 544 | |
| 545 | function getLoader<T, R>(options: ResourceOptions<T, R>): ResourceStreamingLoader<T, R> { |
| 546 | if (isStreamingResourceOptions(options)) { |
| 547 | return options.stream; |
| 548 | } |
| 549 | |
| 550 | return async (params) => { |
| 551 | try { |
| 552 | return signal( |
| 553 | {value: await options.loader(params)}, |
| 554 | ngDevMode ? createDebugNameObject(options.debugName, 'stream') : undefined, |
| 555 | ); |
| 556 | } catch (err) { |
| 557 | return signal( |
| 558 | {error: encapsulateResourceError(err)}, |
| 559 | ngDevMode ? createDebugNameObject(options.debugName, 'stream') : undefined, |
| 560 | ); |
| 561 | } |
| 562 | }; |
| 563 | } |
| 564 | |
| 565 | function isStreamingResourceOptions<T, R>( |
| 566 | options: ResourceOptions<T, R>, |
no test coverage detected
searching dependent graphs…