MCPcopy Create free account
hub / github.com/Effect-TS/effect / handlerLayer

Function handlerLayer

packages/effect/test/unstable/eventlog/EventLog.test.ts:20–27  ·  view source on GitHub ↗
(handled: Ref.Ref<ReadonlyArray<string>>)

Source from the content-addressed store, hash-verified

18const schema = EventLog.schema(UserGroup)
19
20const handlerLayer = (handled: Ref.Ref<ReadonlyArray<string>>) =>
21 EventLog.group(
22 UserGroup,
23 (handlers) =>
24 handlers.handle("UserCreated", ({ payload }) => Ref.update(handled, (values) => [...values, payload.id]))
25 ).pipe(
26 Layer.provide(EventLog.layerRegistry)
27 )
28
29const logLayer = (handled: Ref.Ref<ReadonlyArray<string>>) =>
30 EventLog.layer(schema, handlerLayer(handled)).pipe(

Callers 1

logLayerFunction · 0.85

Calls 5

groupMethod · 0.80
pipeMethod · 0.65
handleMethod · 0.65
updateMethod · 0.45
provideMethod · 0.45

Tested by

no test coverage detected