mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Make changed() run initially
This commit is contained in:
parent
46937c6979
commit
c03fb05779
4 changed files with 24 additions and 1 deletions
|
|
@ -154,3 +154,23 @@ instances.
|
|||
changed("Text", output)
|
||||
}
|
||||
```
|
||||
|
||||
## changed()
|
||||
|
||||
A wrapper for `action()` to listen for property changes.
|
||||
|
||||
- **Type**
|
||||
|
||||
```lua
|
||||
function changed(property: string, callback: (...unknown) -> ()): Action
|
||||
```
|
||||
|
||||
- **Details**
|
||||
|
||||
Will run the given callback any time the property is changed, as well as
|
||||
when the action is initially run.
|
||||
|
||||
The changed connection is disconnected when the reactive scope the action is
|
||||
ran in is destroyed.
|
||||
|
||||
Runs with an action priority of 1.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue