IntervalController
Purpose
Utility controller to wire up other controller actions that need to fire at set intervals.
Actions
Action | Purpose |
---|---|
- | - |
Targets
Target | Purpose | Default |
---|---|---|
- | - | - |
Classes
Class | Purpose | Default |
---|---|---|
- | - | - |
Values
Value | Type | Description | Default |
---|---|---|---|
seconds | Number | The number of seconds between each action | - |
Events
Event | When | Dispatched on | event.detail |
---|---|---|---|
interval:action | Fired every secondsValue seconds, used to wire your desired controller actions to | the controller root element | element : the controller root element |
Side Effects
Calls setInterval
with the desired time value. Cleans up on disconnect.
How to Use
An example: Save the progress of your users through a particularly lengthy form every 30 seconds.
<form data-controller="form-save" data-action="interval:action->form-save#save">
<meta data-controller="interval" data-interval-seconds-value="30" />
</form>