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;
|
item[index] = dset;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
value.register(function (newValue,store)
|
local tween = value.tween;
|
||||||
|
|
||||||
|
-- adding event function
|
||||||
|
local function regFn(newValue,store)
|
||||||
if with then
|
if with then
|
||||||
newValue = with(newValue,item,store);
|
newValue = with(newValue,item,store);
|
||||||
end
|
end
|
||||||
item[index] = newValue;
|
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);
|
end);
|
||||||
elseif (valueType == "function" or valueType == "table") and bind(item,index,value,valueType) then -- connect event
|
elseif (valueType == "function" or valueType == "table") and bind(item,index,value,valueType) then -- connect event
|
||||||
-- event binding
|
-- event binding
|
||||||
|
|
@ -275,4 +286,4 @@ function module.init(shared)
|
||||||
return new;
|
return new;
|
||||||
end
|
end
|
||||||
|
|
||||||
return module;
|
return module;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue