Update docs

This commit is contained in:
aaron 2024-07-03 15:34:16 +01:00
parent 000def5bc2
commit 14f8d38a35
8 changed files with 34 additions and 37 deletions

View file

@ -24,6 +24,7 @@ action used to listen for property changes:
```lua
local action = vide.action
local effect = vide.effect
local cleanup = vide.cleanup
local function changed(prop: string, callback: (new) -> ())
@ -44,9 +45,11 @@ local instance = create "TextBox" {
changed("Text", output)
}
instance.Text = "foo"
effect(function()
print(output())
end)
print(output()) -- "foo"
instance.Text = "foo" -- "foo" will be printed from the effect
```
The source `output` will be updated with the new property value any time it is

View file

@ -3,7 +3,7 @@
Instances are created using `create()`.
Parentheses `()` can be omitted when calling functions with string or
table literals which is recommended for brevity.
table literals for brevity.
```lua
local create = vide.create