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

Function makeClient

packages/effect/src/unstable/eventlog/EventLog.ts:1018–1041  ·  view source on GitHub ↗
(
  schema: EventLogSchema<Groups>
)

Source from the content-addressed store, hash-verified

1016 * @since 4.0.0
1017 */
1018export const makeClient = <Groups extends EventGroup.Any>(
1019 schema: EventLogSchema<Groups>
1020): Effect.Effect<
1021 (<Tag extends Event.Tag<EventGroup.Events<Groups>>>(
1022 event: Tag,
1023 payload: Event.PayloadWithTag<EventGroup.Events<Groups>, Tag>
1024 ) => Effect.Effect<
1025 Event.SuccessWithTag<EventGroup.Events<Groups>, Tag>,
1026 Event.ErrorWithTag<EventGroup.Events<Groups>, Tag> | EventJournalError
1027 >),
1028 never,
1029 EventLog
1030> =>
1031 Effect.gen(function*() {
1032 const log = yield* EventLog
1033
1034 return <Tag extends Event.Tag<EventGroup.Events<Groups>>>(
1035 event: Tag,
1036 payload: Event.PayloadWithTag<EventGroup.Events<Groups>, Tag>
1037 ): Effect.Effect<
1038 Event.SuccessWithTag<EventGroup.Events<Groups>, Tag>,
1039 Event.ErrorWithTag<EventGroup.Events<Groups>, Tag> | EventJournalError
1040 > => log.write({ schema, event, payload })
1041 })

Callers

nothing calls this directly

Calls 1

writeMethod · 0.65

Tested by

no test coverage detected