mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Improve error messages for derived sources
There seemed to be confusion over reactive-scoping (likely due to incomplete docs), so I've added more explicit error messages when deriving in non-reactive scopes to warn the user to use `root()` or `mount()`.
This commit is contained in:
parent
d13f66a1e1
commit
c4a0180a2f
9 changed files with 31 additions and 42 deletions
|
|
@ -7,8 +7,9 @@ local add_cleanup = graph.add_cleanup
|
|||
|
||||
local function cleanup(callback: () -> ())
|
||||
local scope = get_scope()
|
||||
if not scope then
|
||||
throw("cannot cleanup in a non-reactive scope")
|
||||
|
||||
if not scope then
|
||||
throw "cannot cleanup in a non-reactive scope"
|
||||
end; assert(scope)
|
||||
|
||||
add_cleanup(scope, callback)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue