Action Parameters and Updates
Pass parameters to actions and react to parameter changes with the update method.
Parameterized Actions
Actions can accept a second argument: parameters from the consumer.
function tooltip(node, text) {
// ...
}Apply with Parameters
Pass the value with curly braces after the colon.
<button use:tooltip={"Save document"}>Save</button>All lessons in this course
- use: Directive Syntax
- Action Parameters and Updates
- The destroy() Cleanup Function
- Practical Actions: clickOutside tooltip autofocus