MCPcopy Create free account
hub / github.com/callstack/agent-device / firstProviderResult

Function firstProviderResult

src/provider-device-runtime.ts:236–249  ·  view source on GitHub ↗
(
  runtimes: ProviderDeviceRuntime[],
  method: keyof LeaseLifecycleProvider,
  lease: DeviceLease,
  context?: LeaseLifecycleContext,
)

Source from the content-addressed store, hash-verified

234}
235
236async function firstProviderResult(
237 runtimes: ProviderDeviceRuntime[],
238 method: keyof LeaseLifecycleProvider,
239 lease: DeviceLease,
240 context?: LeaseLifecycleContext,
241): Promise<Record<string, unknown> | undefined> {
242 for (const runtime of runtimes) {
243 if (!runtimeMatchesProvider(runtime, lease.leaseProvider)) continue;
244 const handler = runtime.leaseLifecycle[method];
245 const result = handler ? await handler(lease, context) : undefined;
246 if (result) return result;
247 }
248 return undefined;
249}
250
251function runtimeMatchesProvider(
252 runtime: ProviderDeviceRuntime,

Callers 1

composeLeaseProviderFunction · 0.85

Calls 1

runtimeMatchesProviderFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…