Update class.lua
This commit is contained in:
parent
850a64174d
commit
40f06fac9d
1 changed files with 13 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue