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

Function decodePayload

packages/effect/src/unstable/eventlog/EventLog.ts:591–595  ·  view source on GitHub ↗
(tag: Tag, payload: Uint8Array)

Source from the content-addressed store, hash-verified

589 effect: Effect.fnUntraced(function*({ entries, write }): Effect.fn.Return<void> {
590 const isEventTag = (tag: string): tag is Event.Tag<Events> => Object.hasOwn(group.events, tag)
591 const decodePayload = <Tag extends Event.Tag<Events>>(tag: Tag, payload: Uint8Array) =>
592 Schema.decodeUnknownEffect(group.events[tag].payloadMsgPack)(payload).pipe(
593 Effect.updateContext((input) => Context.merge(services, input)),
594 Effect.orDie
595 ) as unknown as Effect.Effect<Event.PayloadWithTag<Events, Tag>>
596 const writePayload = Effect.fnUntraced(function*<Tag extends Event.Tag<Events>>(
597 timestamp: number,
598 tag: Tag,

Callers 3

groupCompactionFunction · 0.70
makeReplayFromRemoteFunction · 0.70

Calls 2

mergeMethod · 0.80
pipeMethod · 0.65

Tested by

no test coverage detected