Renderer.mount: add tests
Some checks failed
NeoVim tests / code-quality (push) Failing after 1m6s

This commit is contained in:
2025-10-11 16:40:07 -06:00
parent 88b9e5f965
commit 629bdf27b4
2 changed files with 102 additions and 0 deletions

View File

@@ -60,6 +60,13 @@ function FnComponentContext:update(new_state)
if self.on_change then vim.schedule(function() self.on_change() end) end
end
--- @private
--- @param new_state TState
function FnComponentContext:update_immediate(new_state)
self.state = new_state
if self.on_change then self.on_change() end
end
--- @alias u.renderer.FnComponent<TProps, TState> fun(ctx: u.renderer.FnComponentContext<TProps, TState>): u.renderer.Tree
--- @class u.renderer.Tag