mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
This commit is contained in:
parent
bbe634f433
commit
31b1956b5a
6 changed files with 54 additions and 41 deletions
|
|
@ -9,7 +9,7 @@ Creates and runs a function in a new reactive scope.
|
|||
- **Type**
|
||||
|
||||
```lua
|
||||
function root<T>(fn: () -> T): (T, () -> ())
|
||||
function root<T...>(fn: (destroy: () -> ()) -> T...): T...
|
||||
```
|
||||
|
||||
- **Details**
|
||||
|
|
@ -19,8 +19,8 @@ Creates and runs a function in a new reactive scope.
|
|||
|
||||
Returns the result of the given function.
|
||||
|
||||
Also returns a function to destroy the root, which will run any cleanups
|
||||
and allow derived sources created to garbage collect.
|
||||
A function to destroy the root is passed into the callback, which will run
|
||||
any cleanups and allow derived sources created to garbage collect.
|
||||
|
||||
::: warning
|
||||
`fn()` cannot yield.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue