typechecked optargs constructors for watcher and event
This commit is contained in:
@@ -38,7 +38,7 @@ local config
|
||||
local Explorer = RootNode:extend()
|
||||
|
||||
---@class Explorer
|
||||
---@overload fun(opts: ExplorerArgs): Explorer
|
||||
---@overload fun(args: ExplorerArgs): Explorer
|
||||
|
||||
---@class (exact) ExplorerArgs
|
||||
---@field path string
|
||||
|
||||
@@ -83,8 +83,12 @@ function M.create_watcher(node)
|
||||
end
|
||||
|
||||
M.uid = M.uid + 1
|
||||
return Watcher:create(path, nil, callback, {
|
||||
context = "explorer:watch:" .. path .. ":" .. M.uid,
|
||||
return Watcher:create({
|
||||
path = path,
|
||||
callback = callback,
|
||||
data = {
|
||||
context = "explorer:watch:" .. path .. ":" .. M.uid
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user