mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Improve docs
This commit is contained in:
parent
0e6e8300fb
commit
04e28f390d
13 changed files with 186 additions and 116 deletions
|
|
@ -16,10 +16,24 @@ Runs a callback anytime a reactive scope is re-ran.
|
|||
local data = source(1)
|
||||
|
||||
watch(function()
|
||||
local label = create "TextLabel" { Text = data }
|
||||
local label = create "TextLabel" { Text = data() }
|
||||
|
||||
cleanup(function()
|
||||
label:Destroy()
|
||||
end)
|
||||
end)
|
||||
```
|
||||
|
||||
```lua
|
||||
local data = source(1)
|
||||
|
||||
derive(function()
|
||||
local label = create "TextLabel" { Text = data() }
|
||||
|
||||
cleanup(function()
|
||||
label:Destroy()
|
||||
end)
|
||||
|
||||
return label
|
||||
end)
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue