Skip to content

Commit

Permalink
Merge pull request #503 from Quenty/users/quenty/signal_memory_tracking
Browse files Browse the repository at this point in the history
users/quenty/signal memory tracking
  • Loading branch information
Quenty authored Oct 4, 2024
2 parents cfa9d31 + 09c816c commit 19d5159
Show file tree
Hide file tree
Showing 70 changed files with 1,204 additions and 1,042 deletions.
6 changes: 3 additions & 3 deletions src/attributeutils/src/Shared/AttributeValue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ end
@within AttributeValue
]=]
function AttributeValue:__index(index)
if index == "Value" then
if AttributeValue[index] then
return AttributeValue[index]
elseif index == "Value" then
local result = self._object:GetAttribute(rawget(self, "_attributeName"))
local default = rawget(self, "_defaultValue")
if result == nil then
Expand All @@ -95,8 +97,6 @@ function AttributeValue:__index(index)
return self._object:GetAttributeChangedSignal(self._attributeName)
elseif index == "AttributeName" then
return rawget(self, "_attributeName")
elseif AttributeValue[index] then
return AttributeValue[index]
else
error(string.format("%q is not a member of AttributeValue", tostring(index)))
end
Expand Down
1 change: 0 additions & 1 deletion src/attributeutils/src/Shared/RxAttributeUtils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function RxAttributeUtils.observeAttribute(instance, attributeName, defaultValue
assert(type(attributeName) == "string", "Bad attributeName")

return Observable.new(function(sub)

local function handleAttributeChanged()
local attributeValue = instance:GetAttribute(attributeName)
if attributeValue == nil then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ function CatalogSearchServiceCache:Init(serviceBag)
return AvatarEditorUtils.promiseSearchCatalog(params)
end)

self._promiseInventoryPages = MemorizeUtils.memoize(function(avatarAssetTypes)
return AvatarEditorUtils.promiseInventoryPages(avatarAssetTypes)
end)
end


function CatalogSearchServiceCache:PromiseSearchCatalog(params)
return self._promiseSearchCatalog(params)
end

function CatalogSearchServiceCache:PromiseInventoryPages(avatarAssetTypes)
return self._promiseInventoryPages(avatarAssetTypes)
end

return CatalogSearchServiceCache
10 changes: 4 additions & 6 deletions src/baseobject/src/Shared/BaseObject.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ BaseObject.__index = BaseObject
@return BaseObject
]=]
function BaseObject.new(obj)
local self = setmetatable({}, BaseObject)

self._maid = Maid.new()
self._obj = obj

return self
return setmetatable({
_maid = Maid.new();
_obj = obj;
}, BaseObject)
end

--[=[
Expand Down
21 changes: 10 additions & 11 deletions src/basicpane/src/Shared/BasicPane.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,8 @@ local DuckTypeUtils = require("DuckTypeUtils")
local ValueObject = require("ValueObject")

local BasicPane = {}
BasicPane.__index = BasicPane
BasicPane.ClassName = "BasicPane"

--[=[
Returns whether the value is a basic pane
@param value any
@return boolean
]=]
function BasicPane.isBasicPane(value)
return DuckTypeUtils.isImplementation(BasicPane, value)
end

BasicPane.__index = BasicPane

--[=[
Constructs a new BasicPane with the .Gui property set.
Expand Down Expand Up @@ -82,6 +72,15 @@ function BasicPane.new(gui)
return self
end

--[=[
Returns whether the value is a basic pane
@param value any
@return boolean
]=]
function BasicPane.isBasicPane(value)
return DuckTypeUtils.isImplementation(BasicPane, value)
end

--[=[
Sets the BasicPane to be visible
Expand Down
Loading

0 comments on commit 19d5159

Please sign in to comment.