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​

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(
self: ObservableMapSet<TKey,TValue>,
observeKey: Observable<TKey> | TKey,
entry: TValue
) → 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(
self: ObservableMapSet<TKey,TValue>,
entry: TValue,
observeKey: Observable<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(self: ObservableMapSet<TKey,TValue>) → {TKey}

Gets a list of all keys.

ObserveKeyList​

ObservableMapSet.ObserveKeyList(self: ObservableMapSet<TKey,TValue>) → Observable<{TKey}>

Observes the list of all keys.

ObserveKeysBrio​

ObservableMapSet.ObserveKeysBrio(self: ObservableMapSet<TKey,TValue>) → Observable<Brio<TKey>>

Observes all keys in the map

GetSetCount​

ObservableMapSet.GetSetCount(self: ObservableMapSet<TKey,TValue>) → number

Gets how many sets exist

ObserveSetCount​

ObservableMapSet.ObserveSetCount(self: ObservableMapSet<TKey,TValue>) → Observable<number>

Observes how many sets exist

ObserveItemsForKeyBrio​

ObservableMapSet.ObserveItemsForKeyBrio(
self: ObservableMapSet<TKey,TValue>,
key: TKey
) → Observable<Brio<TValue>>

Observes all items for the given key

GetFirstItemForKey​

ObservableMapSet.GetFirstItemForKey(
self: ObservableMapSet<TKey,TValue>,
key: TKey
) → TValue?

Gets the first item for the given key

GetListForKey​

ObservableMapSet.GetListForKey(
self: ObservableMapSet<TKey,TValue>,
key: TKey
) → {TValue}

Gets a list for a given key

GetObservableSetForKey​

ObservableMapSet.GetObservableSetForKey(
self: ObservableMapSet<TKey,TValue>,
key: TKey
) → ObservableSet<TValue>

Gets the observable set for the given key

ObserveSetBrio​

ObservableMapSet.ObserveSetBrio(
self: ObservableMapSet<TKey,TValue>,
key: TKey
) → Observable<Brio<ObservableSet<TValue>>>

Observes the observable set for the given key

ObserveCountForKey​

ObservableMapSet.ObserveCountForKey(
self: ObservableMapSet<TKey,TValue>,
key: TKey
) → Observable<number>

Observes the number of entries for the given key

Destroy​

ObservableMapSet.Destroy(self: ObservableMapSet<TKey,TValue>) → ()

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": 40,
                "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": "self",
                    "desc": "",
                    "lua_type": "ObservableMapSet<TKey, TValue>"
                },
                {
                    "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": "static",
            "source": {
                "line": 84,
                "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": "self",
                    "desc": "",
                    "lua_type": "ObservableMapSet<TKey, TValue>"
                },
                {
                    "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": "static",
            "source": {
                "line": 130,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "GetKeyList",
            "desc": "Gets a list of all keys.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ObservableMapSet<TKey, TValue>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ TKey }"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 152,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "ObserveKeyList",
            "desc": "Observes the list of all keys.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ObservableMapSet<TKey, TValue>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<{ TKey }>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 160,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "ObserveKeysBrio",
            "desc": "Observes all keys in the map",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ObservableMapSet<TKey, TValue>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<TKey>>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 168,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "GetSetCount",
            "desc": "Gets how many sets exist",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ObservableMapSet<TKey, TValue>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 176,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "ObserveSetCount",
            "desc": "Observes how many sets exist",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ObservableMapSet<TKey, TValue>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<number>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 186,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "ObserveItemsForKeyBrio",
            "desc": "Observes all items for the given key",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ObservableMapSet<TKey, TValue>"
                },
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "TKey"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<TValue>>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 195,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "GetFirstItemForKey",
            "desc": "Gets the first item for the given key",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ObservableMapSet<TKey, TValue>"
                },
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "TKey"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "TValue?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 217,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "GetListForKey",
            "desc": "Gets a list for a given key",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ObservableMapSet<TKey, TValue>"
                },
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "TKey"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ TValue }"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 233,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "GetObservableSetForKey",
            "desc": "Gets the observable set for the given key",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ObservableMapSet<TKey, TValue>"
                },
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "TKey"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ObservableSet<TValue>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 249,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "ObserveSetBrio",
            "desc": "Observes the observable set for the given key",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ObservableMapSet<TKey, TValue>"
                },
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "TKey"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<ObservableSet<TValue>>>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 264,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "ObserveCountForKey",
            "desc": "Observes the number of entries for the given key",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ObservableMapSet<TKey, TValue>"
                },
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "TKey"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<number>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 281,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Cleans up the ObservableMapSet and sets the metatable to nil.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ObservableMapSet<TKey, TValue>"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 327,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "SetAdded",
            "desc": "Fires when an item is added",
            "lua_type": "Signal<TKey>",
            "readonly": true,
            "source": {
                "line": 52,
                "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
            }
        },
        {
            "name": "SetRemoved",
            "desc": "Fires when an item is removed",
            "lua_type": "Signal<TKey>",
            "readonly": true,
            "source": {
                "line": 60,
                "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": 8,
        "path": "src/observablecollection/src/Shared/ObservableMapSet.lua"
    }
}