mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Update docs
This commit is contained in:
parent
97096f8aff
commit
85b1127551
15 changed files with 200 additions and 298 deletions
|
|
@ -24,20 +24,6 @@ Runs a callback anytime a reactive scope is re-ran.
|
|||
end)
|
||||
```
|
||||
|
||||
```lua
|
||||
local data = source(1)
|
||||
|
||||
derive(function()
|
||||
local label = create "TextLabel" { Text = data() }
|
||||
|
||||
cleanup(function()
|
||||
label:Destroy()
|
||||
end)
|
||||
|
||||
return label
|
||||
end)
|
||||
```
|
||||
|
||||
## untrack()
|
||||
|
||||
Runs a given function where any sources read will not track its reactive scope.
|
||||
|
|
@ -70,4 +56,14 @@ Runs a given function where any sources read will not track its reactive scope.
|
|||
print(sum()) -- 2
|
||||
```
|
||||
|
||||
## read()
|
||||
|
||||
Utility used to read a value that is either a primitive or a source.
|
||||
|
||||
- **Type**
|
||||
|
||||
```lua
|
||||
function read<T>(value: T | () -> T): T
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue