Update docs

This commit is contained in:
Aaron Smith 2023-09-20 18:42:29 +01:00
parent 97096f8aff
commit 85b1127551
15 changed files with 200 additions and 298 deletions

View file

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