Skip to content

EventCheckContext

type EventCheckContext<TPayload, TFilter> = {
input: z.infer<TFilter>;
payload: z.infer<TPayload>;
};

Defined in: core/src/event/event.types.ts:11

What check gets to decide with: the occurrence that just happened, and the filter value the subscriber supplied. Both are parsed values, not schemas.

Deliberately nothing else. check runs once per subscriber per occurrence, so it has to stay cheap; an event that needs to reach further for a decision should close over what it needs where it is defined.

Type Parameter Default type
TPayload extends z.ZodType z.ZodType
TFilter extends z.ZodType z.ZodType
input: z.infer<TFilter>;

Defined in: core/src/event/event.types.ts:13


payload: z.infer<TPayload>;

Defined in: core/src/event/event.types.ts:12