MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / use

Function use

packages/core/sdk/src/fuma-runtime.ts:363–366  ·  view source on GitHub ↗
(label, fn)

Source from the content-addressed store, hash-verified

361 const rebind = (handle: FumaDb): FumaDb =>
362 options.context === undefined ? handle : withQueryContext(handle, options.context);
363 const use: IFumaClient["use"] = (label, fn) =>
364 Effect.flatMap(Effect.service(activeFumaDbRef), (active) =>
365 fumaEffect(label, () => fn(makeSafeFumaQuery(rebind(active ?? db), options))),
366 ).pipe(Effect.withSpan(`fumadb.${label}`));
367
368 const transaction = <A, E>(effect: Effect.Effect<A, E>): Effect.Effect<A, E | StorageFailure> =>
369 Effect.flatMap(Effect.service(activeFumaDbRef), (active) => {

Callers 3

withOAuthFixtureFunction · 0.70
withTokenEndpointFunction · 0.70
useSecretFormFunction · 0.50

Calls 3

fumaEffectFunction · 0.85
makeSafeFumaQueryFunction · 0.85
rebindFunction · 0.85

Tested by 2

withOAuthFixtureFunction · 0.56
withTokenEndpointFunction · 0.56