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
000def5bc2
commit
14f8d38a35
8 changed files with 34 additions and 37 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue