how to perform some stuff before dispatching an event in action - Filament