(handled: Ref.Ref<ReadonlyArray<string>>)
| 18 | const schema = EventLog.schema(UserGroup) |
| 19 | |
| 20 | const 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 | |
| 29 | const logLayer = (handled: Ref.Ref<ReadonlyArray<string>>) => |
| 30 | EventLog.layer(schema, handlerLayer(handled)).pipe( |