mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Initial commit
This commit is contained in:
commit
cb002f4f27
50 changed files with 4666 additions and 0 deletions
25
docs/api/reactivity-utility.md
Normal file
25
docs/api/reactivity-utility.md
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Reactivity API: Utility
|
||||
|
||||
## cleanup()
|
||||
|
||||
Runs a callback anytime a reactive scope is re-ran.
|
||||
|
||||
- **Type**
|
||||
|
||||
```lua
|
||||
function cleanup(callback: () -> ())
|
||||
```
|
||||
|
||||
- **Example**
|
||||
|
||||
```lua
|
||||
local data = source(1)
|
||||
|
||||
watch(function()
|
||||
local label = create "TextLabel" { Text = data }
|
||||
|
||||
cleanup(function()
|
||||
label:Destroy()
|
||||
end)
|
||||
end)
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue