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

Function use

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

Source from the content-addressed store, hash-verified

150
151export const makeFumaClient = (db: FumaDb, options: MakeFumaClientOptions = {}): IFumaClient => {
152 const use: IFumaClient["use"] = (label, fn) =>
153 Effect.flatMap(Effect.service(activeFumaDbRef), (active) =>
154 fumaEffect(label, () => fn(makeSafeFumaQuery(active ?? db, options))),
155 ).pipe(Effect.withSpan(`fumadb.${label}`));
156
157 const transaction = <A, E>(effect: Effect.Effect<A, E>): Effect.Effect<A, E | StorageFailure> =>
158 Effect.flatMap(Effect.service(activeFumaDbRef), (active) => {

Callers 3

withOAuthFixtureFunction · 0.70
withTokenEndpointFunction · 0.70
useSecretFormFunction · 0.50

Calls 2

fumaEffectFunction · 0.85
makeSafeFumaQueryFunction · 0.85

Tested by 2

withOAuthFixtureFunction · 0.56
withTokenEndpointFunction · 0.56