ReactionResolver
@rotorsoft/act-root / act/src / ReactionResolver
Type Alias: ReactionResolver<TEvents, TKey, TLane>
ReactionResolver<
TEvents,TKey,TLane> =Resolved<TLane> | ((event) =>Resolved<TLane> |undefined)
Defined in: libs/act/src/types/reaction.ts:83
Resolver for determining which stream a reaction should target.
Resolvers enable dynamic reaction routing based on event content. They can be:
- Static: Always route to the same target stream
- Dynamic: Determine target based on event data at runtime
Resolvers can also specify source streams for optimization, allowing the drain
process to efficiently fetch only relevant events. An optional priority
biases the lagging-frontier claim() ordering — see Resolved.priority.
Type Parameters
TEvents
TEvents extends Schemas
Event schemas
TKey
TKey extends keyof TEvents
Event name
TLane
TLane extends string = string
Param
event
The committed event (for dynamic resolvers)
Returns
Target stream configuration or undefined to skip
Example
Static target
.on("UserCreated")
.do(sendWelcomeEmail)
.to("email-queue") // Static target