Update class.lua

This commit is contained in:
세젤귀 고양이들 2021-12-19 01:16:26 +09:00 committed by GitHub
parent 850a64174d
commit 40f06fac9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,11 +91,22 @@ function module.init(shared)
item[index] = dset;
end
end
value.register(function (newValue,store)
local tween = value.tween;
-- adding event function
local function regFn(newValue,store)
if with then
newValue = with(newValue,item,store);
end
item[index] = newValue;
end
value.register(regFn);
-- this is using hacky of roblox instance
-- this is will keep reference from week table until
-- inscance got GCed
item:GetPropertyChangedSignal("ClassName"):Connect(function ()
return regFn;
end);
elseif (valueType == "function" or valueType == "table") and bind(item,index,value,valueType) then -- connect event
-- event binding
@ -275,4 +286,4 @@ function module.init(shared)
return new;
end
return module;
return module;