Sequence
DSL function to group events sequentially
Sequence
Module: jindong-compose | Package: io.github.compose.jindong.dsl
Groups haptic events to run one after another.
Signature
Parameters
| Parameter | Type | Description |
|---|---|---|
content | @Composable JindongScope.() -> Unit | The pattern to execute sequentially |
Description
Sequence groups haptic events into a single sequential block. While events at the top level of Jindong already run sequentially, Sequence is useful for:
- Organizing complex patterns
- Creating reusable pattern groups
- Nesting within
Repeator other structures
Usage
Basic Usage
Inside Repeat
Most common use - organizing patterns within repetition:
Pattern Organization
Group related events for clarity:
Examples
Double Tap Sequence
Alert Pattern
Complex Rhythm
When to Use
| Scenario | Use Sequence? |
|---|---|
| Simple pattern | Not needed |
| Organizing code | Optional, for clarity |
| Inside Repeat | Recommended |
| Nested structures | Recommended |
Notes
Sequencedoesn't change timing behavior- It's primarily for code organization
- Events inside still run sequentially (as they would outside)
- Useful for making patterns more readable