Skip to main content

AdorneeDataValue

Allows access to an attribute like a ValueObject but in table form.

local data = AdorneeDataValue.new(workspace, {
	Version = "1.0.0";
	CFrame = CFrame.new();
})
print(data.Version.Value) --> 1.0.0
print(workspace:GetAttribute("version")) --> 1.0.0

data.Version.Changed:Connect(function()
	print(data.Version.Value)
end)

workspace:SetAttribute("1.1.0") --> 1.1.0
data.Value = "1.2.0" --> 1.2.0

Properties

Value

AdorneeDataValue.Value: T

The current property of the Attribute. Can be assigned to to write the attribute.

Changed

This item is read only and cannot be modified. Read Only
AdorneeDataValue.Changed: Signal<()>

Signal that fires when the attribute changes

Functions

new

AdorneeDataValue.new(
adorneeInstance,
prototypetable
) → AdorneeDataValue<T>

Constructs a new AdorneeDataValue

Observe

AdorneeDataValue:Observe() → Observable<any>

Observes an attribute on an instance.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new AdorneeDataValue",
            "params": [
                {
                    "name": "adornee",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "prototype",
                    "desc": "",
                    "lua_type": "table"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "AdorneeDataValue<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 41,
                "path": "src/adorneedata/src/Shared/AdorneeDataValue.lua"
            }
        },
        {
            "name": "Observe",
            "desc": "Observes an attribute on an instance.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<any>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 104,
                "path": "src/adorneedata/src/Shared/AdorneeDataValue.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "Value",
            "desc": "The current property of the Attribute. Can be assigned to to write\nthe attribute.",
            "lua_type": "T",
            "source": {
                "line": 68,
                "path": "src/adorneedata/src/Shared/AdorneeDataValue.lua"
            }
        },
        {
            "name": "Changed",
            "desc": "Signal that fires when the attribute changes",
            "lua_type": "Signal<()>",
            "readonly": true,
            "source": {
                "line": 75,
                "path": "src/adorneedata/src/Shared/AdorneeDataValue.lua"
            }
        }
    ],
    "types": [],
    "name": "AdorneeDataValue",
    "desc": "Allows access to an attribute like a ValueObject but in table form.\n\n```lua\nlocal data = AdorneeDataValue.new(workspace, {\n\tVersion = \"1.0.0\";\n\tCFrame = CFrame.new();\n})\nprint(data.Version.Value) --> 1.0.0\nprint(workspace:GetAttribute(\"version\")) --> 1.0.0\n\ndata.Version.Changed:Connect(function()\n\tprint(data.Version.Value)\nend)\n\nworkspace:SetAttribute(\"1.1.0\") --> 1.1.0\ndata.Value = \"1.2.0\" --> 1.2.0\n```",
    "source": {
        "line": 22,
        "path": "src/adorneedata/src/Shared/AdorneeDataValue.lua"
    }
}