You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using plugins to do some validations on events, there are certain events I will like to discard if a certain condition is met. I have tried using ctx.cancel or throwing an error hoping the event pipeline stops but its just retries. How do I go about discarding events ? Refer to the example code below
const filterEvents: Plugin = {
name: 'Filter events',
type: 'before',
version: '1.0.0',
isLoaded: () => true,
load: () => Promise.resolve(),
track: (ctx: Context) => {
// if some condition is met I want to discard this event and stop the pipeline processing
if (condition met) {
ctx.cancel();
}
return ctx;
};
};
The text was updated successfully, but these errors were encountered:
Hi,
I am using plugins to do some validations on events, there are certain events I will like to discard if a certain condition is met. I have tried using ctx.cancel or throwing an error hoping the event pipeline stops but its just retries. How do I go about discarding events ? Refer to the example code below
The text was updated successfully, but these errors were encountered: