Skip to main content

ObservableList

A list that can be observed for blend and other components

Properties​

ItemAdded​

This item is read only and cannot be modified. Read Only
ObservableList.ItemAdded: Signal<T,number,Symbol>

Fires when an item is added

ItemRemoved​

This item is read only and cannot be modified. Read Only
ObservableList.ItemRemoved: Signal<T,Symbol>

Fires when an item is removed.

CountChanged​

ObservableList.CountChanged: RBXScriptSignal

Fires when the count changes.

Functions​

new​

ObservableList.new() → ObservableList<T>

Constructs a new ObservableList

isObservableList​

ObservableList.isObservableList(value: any) → boolean

Returns whether the value is an observable list

ObserveItemsBrio​

ObservableList:ObserveItemsBrio() → Observable<Brio<T>>

Observes all items in the list

ObserveIndex​

ObservableList:ObserveIndex(indexToObserve: number) → Observable<number>

Observes the index as it changes, until the entry at the existing index is removed.

RemoveFirst​

ObservableList:RemoveFirst(value: T) → boolean

Removes the first instance found in contents

GetCountValue​

ObservableList:GetCountValue() → IntValue

Returns an IntValue that represents the CountValue

ObserveIndexByKey​

ObservableList:ObserveIndexByKey(key: Symbol) → Observable<number>

Observes the index as it changes, until the entry at the existing key is removed.

GetIndexByKey​

ObservableList:GetIndexByKey(key: Symbol) → number

Gets the current index from the key

GetCount​

ObservableList:GetCount() → number

Gets the count of items in the list

ObserveCount​

ObservableList:ObserveCount() → Observable<number>

Observes the count of the list

Add​

ObservableList:Add(item: T) → callback--

Call to remove

Adds the item to the list at the specified index

Get​

ObservableList:Get(index: number) → T?

Gets the current item at the index, or nil if it is not defined.

InsertAt​

ObservableList:InsertAt(
item: T,
index: number?
) → callback--

Call to remove

Adds the item to the list at the specified index

RemoveAt​

ObservableList:RemoveAt(index: number) → T

Removes the item at the index

RemoveByKey​

ObservableList:RemoveByKey(key: Symbol) → T

Removes the item from the list if it exists.

GetList​

ObservableList:GetList() → {T}

Gets a list of all entries.

Destroy​

ObservableList:Destroy() → ()

Cleans up the ObservableList and sets the metatable to nil.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new ObservableList",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ObservableList<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 23,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "isObservableList",
            "desc": "Returns whether the value is an observable list",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 71,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "ObserveItemsBrio",
            "desc": "Observes all items in the list",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<T>>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 79,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "ObserveIndex",
            "desc": "Observes the index as it changes, until the entry at the existing\nindex is removed.",
            "params": [
                {
                    "name": "indexToObserve",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<number>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 115,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "RemoveFirst",
            "desc": "Removes the first instance found in contents",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "T"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 132,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "GetCountValue",
            "desc": "Returns an IntValue that represents the CountValue",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "IntValue"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 148,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "ObserveIndexByKey",
            "desc": "Observes the index as it changes, until the entry at the existing\nkey is removed.",
            "params": [
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "Symbol"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<number>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 159,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "GetIndexByKey",
            "desc": "Gets the current index from the key",
            "params": [
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "Symbol"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 200,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "GetCount",
            "desc": "Gets the count of items in the list",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 213,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "ObserveCount",
            "desc": "Observes the count of the list",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<number>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 221,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "Add",
            "desc": "Adds the item to the list at the specified index",
            "params": [
                {
                    "name": "item",
                    "desc": "",
                    "lua_type": "T"
                }
            ],
            "returns": [
                {
                    "desc": "Call to remove",
                    "lua_type": "callback"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 230,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "Get",
            "desc": "Gets the current item at the index, or nil if it is not defined.",
            "params": [
                {
                    "name": "index",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "T?"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 239,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "InsertAt",
            "desc": "Adds the item to the list at the specified index",
            "params": [
                {
                    "name": "item",
                    "desc": "",
                    "lua_type": "T"
                },
                {
                    "name": "index",
                    "desc": "",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "Call to remove",
                    "lua_type": "callback"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 256,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "RemoveAt",
            "desc": "Removes the item at the index",
            "params": [
                {
                    "name": "index",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "T"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 325,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "RemoveByKey",
            "desc": "Removes the item from the list if it exists.",
            "params": [
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "Symbol"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "T"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 341,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "GetList",
            "desc": "Gets a list of all entries.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ T }"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 424,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Cleans up the ObservableList and sets the metatable to nil.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 435,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "ItemAdded",
            "desc": "Fires when an item is added",
            "lua_type": "Signal<T, number, Symbol>",
            "readonly": true,
            "source": {
                "line": 44,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "ItemRemoved",
            "desc": "Fires when an item is removed.",
            "lua_type": "Signal<T, Symbol>",
            "readonly": true,
            "source": {
                "line": 53,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        },
        {
            "name": "CountChanged",
            "desc": "Fires when the count changes.",
            "lua_type": "RBXScriptSignal",
            "source": {
                "line": 61,
                "path": "src/observablecollection/src/Shared/ObservableList.lua"
            }
        }
    ],
    "types": [],
    "name": "ObservableList",
    "desc": "A list that can be observed for blend and other components",
    "source": {
        "line": 5,
        "path": "src/observablecollection/src/Shared/ObservableList.lua"
    }
}