Skip to main content

ObservableMapSet

Holds a map of sets. That is, for a given key, a set of all valid entries. This is great for looking up something that may have duplicate keys, like configurations or other things.

Properties

ListAdded

This item is read only and cannot be modified. Read Only
ObservableMapSet.ListAdded: Signal<TKey>

Fires when an item is added

ListRemoved

This item is read only and cannot be modified. Read Only
ObservableMapSet.ListRemoved: Signal<TKey>

Fires when an item is removed

SetAdded

This item is read only and cannot be modified. Read Only
ObservableMapSet.SetAdded: Signal<TKey>

Fires when an item is added

SetRemoved

This item is read only and cannot be modified. Read Only
ObservableMapSet.SetRemoved: Signal<TKey>

Fires when an item is removed

Functions

new

ObservableMapSet.new() → ObservableMapSet<TKey,TValue>

Constructs a new ObservableMapSet

Push

ObservableMapSet:Push(
observeKeyObservable<TKey> | TKey,
entryTValue
) → MaidTask--

Cleanup object that will remove the entry

Adds an entry with a dynamic key. This is great for caching things that need to be looked up by key.

tip

If observeKey emits nil then the value will be excluded from the map.

Add

ObservableMapSet:Add(
entryTValue,
observeKeyObservable<TKey> | TKey
) → MaidTask--

Cleanup object that will remove the entry

Adds an entry with a dynamic key. This is great for caching things that need to be looked up by key.

This code is legacy code since our argument order isn't intuitive

tip

If observeKey emits nil then the value will be excluded from the map.

GetKeyList

ObservableMapSet:GetKeyList() → {TKey}

Gets a list of all keys.

ObserveKeyList

ObservableMapSet:ObserveKeyList() → Observable<{TKey}>

Observes the list of all keys.

ObserveKeysBrio

ObservableMapSet:ObserveKeysBrio() → Observable<Brio<TKey>>

Observes all keys in the map

GetSetCount

ObservableMapSet:GetSetCount() → number

Gets how many sets exist

ObserveSetCount

ObservableMapSet:ObserveSetCount() → Observable<number>

Observes how many sets exist

ObserveItemsForKeyBrio

ObservableMapSet:ObserveItemsForKeyBrio(keyTKey) → Observable<Brio<TValue>>

Observes all items for the given key

GetFirstItemForKey

ObservableMapSet:GetFirstItemForKey(keyTKey) → TValue | nil

Gets the first item for the given key

GetListForKey

ObservableMapSet:GetListForKey(keyTKey) → {TValue}

Gets a list for a given key

GetObservableSetForKey

ObservableMapSet:GetObservableSetForKey(keyTKey) → ObservableSet<TValue>

Gets the observable set for the given key

ObserveSetBrio

ObservableMapSet:ObserveSetBrio(keyTKey) → Observable<Brio<ObservableSet<TValue>>>

Observes the observable set for the given key

ObserveCountForKey

ObservableMapSet:ObserveCountForKey(keyTKey) → Observable<number>

Observes the number of entries for the given key

Destroy

ObservableMapSet:Destroy() → ()

Cleans up the ObservableMapSet and sets the metatable to nil.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new ObservableMapSet",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ObservableMapSet<TKey, TValue>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 25,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "Push",
            "desc": "Adds an entry with a dynamic key. This is great for caching things\nthat need to be looked up by key.\n\n:::tip\nIf `observeKey` emits nil then the value will be excluded from the map.\n:::",
            "params": [
                {
                    "name": "observeKey",
                    "desc": "",
                    "lua_type": "Observable<TKey> | TKey"
                },
                {
                    "name": "entry",
                    "desc": "",
                    "lua_type": "TValue"
                }
            ],
            "returns": [
                {
                    "desc": "Cleanup object that will remove the entry",
                    "lua_type": "MaidTask"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 69,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "Add",
            "desc": "Adds an entry with a dynamic key. This is great for caching things\nthat need to be looked up by key.\n\nThis code is legacy code since our argument order isn't intuitive\n\n:::tip\nIf `observeKey` emits nil then the value will be excluded from the map.\n:::",
            "params": [
                {
                    "name": "entry",
                    "desc": "",
                    "lua_type": "TValue"
                },
                {
                    "name": "observeKey",
                    "desc": "",
                    "lua_type": "Observable<TKey> | TKey"
                }
            ],
            "returns": [
                {
                    "desc": "Cleanup object that will remove the entry",
                    "lua_type": "MaidTask"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 111,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "GetKeyList",
            "desc": "Gets a list of all keys.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ TKey }"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 125,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "ObserveKeyList",
            "desc": "Observes the list of all keys.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<{ TKey }>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 133,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "ObserveKeysBrio",
            "desc": "Observes all keys in the map",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<TKey>>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 141,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "GetSetCount",
            "desc": "Gets how many sets exist",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 149,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "ObserveSetCount",
            "desc": "Observes how many sets exist",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<number>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 157,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "ObserveItemsForKeyBrio",
            "desc": "Observes all items for the given key",
            "params": [
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "TKey"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<TValue>>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 166,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "GetFirstItemForKey",
            "desc": "Gets the first item for the given key",
            "params": [
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "TKey"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "TValue | nil"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 185,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "GetListForKey",
            "desc": "Gets a list for a given key",
            "params": [
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "TKey"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ TValue }"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 201,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "GetObservableSetForKey",
            "desc": "Gets the observable set for the given key",
            "params": [
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "TKey"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ObservableSet<TValue>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 217,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "ObserveSetBrio",
            "desc": "Observes the observable set for the given key",
            "params": [
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "TKey"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<ObservableSet<TValue>>>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 229,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "ObserveCountForKey",
            "desc": "Observes the number of entries for the given key",
            "params": [
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "TKey"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<number>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 241,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Cleans up the ObservableMapSet and sets the metatable to nil.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 282,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "ListAdded",
            "desc": "Fires when an item is added",
            "lua_type": "Signal<TKey>",
            "readonly": true,
            "source": {
                "line": 36,
                "path": "src/observablecollection/src/Shared/ObservableMapList.lua"
            }
        },
        {
            "name": "ListRemoved",
            "desc": "Fires when an item is removed",
            "lua_type": "Signal<TKey>",
            "readonly": true,
            "source": {
                "line": 44,
                "path": "src/observablecollection/src/Shared/ObservableMapList.lua"
            }
        },
        {
            "name": "SetAdded",
            "desc": "Fires when an item is added",
            "lua_type": "Signal<TKey>",
            "readonly": true,
            "source": {
                "line": 37,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "SetRemoved",
            "desc": "Fires when an item is removed",
            "lua_type": "Signal<TKey>",
            "readonly": true,
            "source": {
                "line": 45,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        }
    ],
    "types": [],
    "name": "ObservableMapSet",
    "desc": "Holds a map of sets. That is, for a given key, a set of all valid entries. This is great\nfor looking up something that may have duplicate keys, like configurations or other things.",
    "source": {
        "line": 7,
        "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
    }
}