Skip to main content

BinderGroup

Groups binders together into a list, and allows binders to be dynamically added or removed.

Also allows their interface to be validated using a validation function. This ensures that all added objects are the same type, so they can be used for dynamic interactions.

Functions

new

BinderGroup.new(
binders{Binder<T>},--

A list of binders that

validateConstructor(constructorany) → boolean--

Validates a binder matches T

) → BinderGroup<T>

Constructs a new BinderGroup

AddList

BinderGroup:AddList(binders{Binder<T>}) → ()

Adds a list of binders to the group.

Add

BinderGroup:Add(binderBinder<T>) → ()

Adds the specific binder to the list

GetBinders

BinderGroup:GetBinders() → {T}

Returns a list of binders.

warning

Do not modify the list of binders returned here

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new BinderGroup",
            "params": [
                {
                    "name": "binders",
                    "desc": "A list of binders that",
                    "lua_type": "{ Binder<T> }"
                },
                {
                    "name": "validateConstructor",
                    "desc": "Validates a binder matches T",
                    "lua_type": "(constructor: any) -> boolean"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "BinderGroup<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 28,
                "path": "src/binder/src/Shared/BinderGroup.lua"
            }
        },
        {
            "name": "AddList",
            "desc": "Adds a list of binders to the group.",
            "params": [
                {
                    "name": "binders",
                    "desc": "",
                    "lua_type": "{ Binder<T> }"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 47,
                "path": "src/binder/src/Shared/BinderGroup.lua"
            }
        },
        {
            "name": "Add",
            "desc": "Adds the specific binder to the list",
            "params": [
                {
                    "name": "binder",
                    "desc": "",
                    "lua_type": "Binder<T>"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 62,
                "path": "src/binder/src/Shared/BinderGroup.lua"
            }
        },
        {
            "name": "GetBinders",
            "desc": "Returns a list of binders.\n\n:::warning\nDo not modify the list of binders returned here\n:::",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ T }"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 89,
                "path": "src/binder/src/Shared/BinderGroup.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "BinderGroup",
    "desc": "Groups binders together into a list, and allows binders to be dynamically\nadded or removed.\n\nAlso allows their interface to be validated using a validation function.\nThis ensures that all added objects are the same type, so they can be used\nfor dynamic interactions.",
    "source": {
        "line": 11,
        "path": "src/binder/src/Shared/BinderGroup.lua"
    }
}