-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
WDYT about adding optional additional filtering to event.pattern? This would allow to listen to a subset of event patterns.
Right now we're accomplishing it by doing something like this:
const eventBridgePattern: DeepPartial<Input> = {
detail: { status: [RentalDeliveryStatus.DELIVERED] as unknown as Input['detail']['status'] }, // Make sure this value is somewhat linked to event type
};
...
events: [
{
eventBridge: {
eventBus: 'bus',
// Augmenting the default typebridge pattern, to only listen to events with status "DELIVERED"
pattern: {
...event.pattern,
...eventBridgePattern,
},
},
},
],would be amazing in our use case to have something more like this: event.pattern({ status: "Delivered" })
let me know what you think, would be happy to create a PR regarding this π
adriencaccia
Metadata
Metadata
Assignees
Labels
No labels