Improve docs

This commit is contained in:
Aaron Smith 2023-08-09 15:33:14 +01:00
parent 0e6e8300fb
commit 04e28f390d
13 changed files with 186 additions and 116 deletions

View file

@ -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)
```