Cancel Element
Element for canceling delayed events
Cancel Element
Coming soon: This feature is not yet available. Please check back soon.
The <cancel>
element cancels a delayed event:
Prop | Type | Default |
---|---|---|
id? | string | - |
sendid? | string | - |
sendidexpr? | Expression | - |
Examples
Basic Cancellation
Dynamic Cancellation
Multiple Event Cancellation
Usage Notes
- Use when you need to prevent a delayed event from occurring
- Commonly used in cleanup operations
- Useful for canceling timeouts and reminders
- Can be used with dynamic event IDs
Best Practices
-
Event Management
- Keep track of event IDs systematically
- Use meaningful event IDs
- Clean up pending events when appropriate
- Handle cases where the event might already be executed
-
Error Handling
- Handle cases where the event ID doesn't exist
- Provide appropriate feedback for cancellation failures
- Log cancellation operations for debugging
-
State Coordination
- Coordinate with send elements
- Consider the timing of cancellations
- Handle race conditions
- Clean up related state data
-
Documentation
- Document which events can be canceled
- Explain cancellation conditions
- Note any side effects
- Include timing considerations