helium
helium copied to clipboard
Can't read from a context in `input` subscription
In a child element, a context can't be read from in a input sub though writing to it is perfectly valid. Sample elements to reproduce:-
local ChildFactory = helium(function(param, view)
local ctx = context.get("ctx")
input("clicked", function()
local c = ctx.value -- FAILS
end)
return function()
love.graphics.print(ctx.value, 20, 20)
end
end)
local ParentFactory = helium(function(param, view)
local ctx = context.use("ctx", {value = "Lorem ipsum"})
local c = ChildFactory({}, 100, 100)
return function()
c:draw()
end
end)