Fusion
Fusion copied to clipboard
Tween freezing when goal and info compute from the same state
It seems that Tween stops working if both the goalState and tweenInfo are states and have the same dependency. I may be missing something, or maybe this is just an antipattern but in me eyes it should work?
Repro:
local isVisible = Value(false)
local info = Computed(function()
local direction = if isVisible:get() then Enum.EasingDirection.Out else Enum.EasingDirection.In
return TweenInfo.new(0.6, Enum.EasingStyle.Back, direction)
end)
local size = Computed(function()
return if isVisible:get() then UDim2.fromScale(1, 1) else UDim2.fromScale(0.25, 0.25)
end)
local tween = Tween(size, info)
-- affects the size and info separately, but not the tween
isVisible:set(true)
Haven't tested this yet, but off the top of my head I think I know why this may be - the Tween's :update() function only runs once, but also is coded in such a fashion as to only expect one of the two states to have changed.
#145 would help with this I think.
Related to #205