Show raw api
{
"functions": [
{
"name": "new",
"desc": "Constructs a new AttributeValue. If a defaultValue that is not nil\nis defined, then this value will be set on the Roblox object.",
"params": [
{
"name": "object",
"desc": "",
"lua_type": "Instance"
},
{
"name": "attributeName",
"desc": "",
"lua_type": "string"
},
{
"name": "defaultValue",
"desc": "",
"lua_type": "T?"
}
],
"returns": [
{
"desc": "",
"lua_type": "AttributeValue<T>"
}
],
"function_type": "static",
"source": {
"line": 73,
"path": "src/attributeutils/src/Shared/AttributeValue.lua"
}
},
{
"name": "ObserveBrio",
"desc": "Handles observing the value conditionally",
"params": [
{
"name": "self",
"desc": "",
"lua_type": "AttributeValue<T>"
},
{
"name": "condition",
"desc": "",
"lua_type": "((T) -> boolean)?"
}
],
"returns": [
{
"desc": "",
"lua_type": "Observable<Brio<T>>"
}
],
"function_type": "static",
"source": {
"line": 99,
"path": "src/attributeutils/src/Shared/AttributeValue.lua"
}
},
{
"name": "Observe",
"desc": "Observes an attribute on an instance, falling back to the default value\nwhenever the attribute is not set.",
"params": [
{
"name": "self",
"desc": "",
"lua_type": "AttributeValue<T>"
}
],
"returns": [
{
"desc": "",
"lua_type": "Observable<T>"
}
],
"function_type": "static",
"source": {
"line": 112,
"path": "src/attributeutils/src/Shared/AttributeValue.lua"
}
}
],
"properties": [],
"types": [],
"name": "AttributeValue",
"desc": "Allows access to an attribute like a ValueObject.\n\n```lua\nlocal attributeValue = AttributeValue.new(workspace, \"Version\", \"1.0.0\")\nprint(attributeValue.Value) --> 1.0.0\nprint(workspace:GetAttribute(\"version\")) --> 1.0.0\n\nattributeValue.Changed:Connect(function()\n\tprint(attributeValue.Value)\nend)\n\nworkspace:SetAttribute(\"1.1.0\") --> 1.1.0\nattributeValue.Value = \"1.2.0\" --> 1.2.0\n```",
"source": {
"line": 20,
"path": "src/attributeutils/src/Shared/AttributeValue.lua"
}
}