Skip to content

Can't read from a context in input subscription #24

@IsometricShahil

Description

@IsometricShahil

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions