ok so im using Fusion and when i try to do this (not the actual code)
local moduleValue = Value (somemodule)
New "TextLabel" {
Text = Computed(function()
local module = moduleValue:get()
return module.Source
end)
}
and change the module’s source, it doesn’t update the text, instead it only updates if moduleValue's value is changed. i tried to store the module’s source in a separate value object but i just couldn’t figure it out
Changing a table inside a Value doesn’t update any dependencies of that Value. To update the dependencies, you must call :set() on the Value.
What you can do depends on how much control you have over the module. You could modify somemodule.Source to be a StateObject, in which case you could just directly set it inside of the New.
New "TextLabel" {
Text = somemodule.Source
}
If you can’t modify the module, see if the module has some way to listen for changes to the Source property, and instead use a Value that you call :set on with the new Source every time it changes.
If the module doesn’t have a way to listen to changes, the only way would be to poll for it every frame, but I don’t recommend this option.