MCPcopy Create free account
hub / github.com/angular/angular / chain

Function chain

packages/core/src/resource/resource.ts:670–681  ·  view source on GitHub ↗
(resource: Resource<T>)

Source from the content-addressed store, hash-verified

668 * the current resource by throwing the appropriate status code when the value is not available.
669 */
670export function chain<T>(resource: Resource<T>): T {
671 switch (resource.status()) {
672 case 'idle':
673 throw ResourceParamsStatus.IDLE;
674 case 'error':
675 throw new ResourceDependencyError(resource);
676 case 'loading':
677 case 'reloading':
678 throw ResourceParamsStatus.LOADING;
679 }
680 return resource.value();
681}
682
683export const paramsContext: ResourceParamsContext = {
684 chain,

Callers 5

index.tsFile · 0.50
migrateFunction · 0.50
DebounceBugClass · 0.50
myServiceFunction · 0.50

Calls 2

valueMethod · 0.65
statusMethod · 0.45

Tested by

no test coverage detected