MCPcopy Create free account
hub / github.com/effect-app/libs / effect

Function effect

packages/e2e/test/repoInvalidation.e2e.test.ts:116–128  ·  view source on GitHub ↗
(match)

Source from the content-addressed store, hash-verified

114const router = Router(RepoRpcs)({
115 dependencies: [RepoItems.Default, OtherItems.Default],
116 *effect(match) {
117 const repo = yield* RepoItems
118 const otherRepo = yield* OtherItems
119 return match({
120 GetRepoCount: () =>
121 Effect
122 .sync(() => repoCountRuns++)
123 .pipe(Effect.andThen(repo.all), Effect.map((items) => items.length), Effect.orDie),
124 GetRepoCountRuns: () => Effect.sync(() => repoCountRuns),
125 SaveRepoItem: ({ id, label }) => repo.save(new RepoItem({ id, label })).pipe(Effect.orDie),
126 SaveOtherItem: ({ id, label }) => otherRepo.save(new OtherItem({ id, label })).pipe(Effect.orDie)
127 })
128 }
129})
130
131const RpcRouterLayer = matchAll({ router })

Callers

nothing calls this directly

Calls 4

syncMethod · 0.80
pipeMethod · 0.65
mapMethod · 0.65
matchFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…