MCPcopy Index your code
hub / github.com/angular/angular / throwStatusAndErrors

Function throwStatusAndErrors

packages/core/test/resource/params_status_spec.ts:12–19  ·  view source on GitHub ↗
(source: () => T | ResourceParamsStatus | Error)

Source from the content-addressed store, hash-verified

10import {TestBed} from '../../testing';
11
12function throwStatusAndErrors<T>(source: () => T | ResourceParamsStatus | Error): () => T {
13 return () => {
14 const value = source();
15 if (value instanceof Error) throw value;
16 if (value === ResourceParamsStatus.IDLE || value === ResourceParamsStatus.LOADING) throw value;
17 return value as T;
18 };
19}
20
21describe('resource with ResourceParamsStatus', () => {
22 it('should transition to idle when params throws ResourceParamsStatus.IDLE', async () => {

Callers 1

Calls 1

sourceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…