Skip to main content

ScopeUtil

This item only works when running on the client. Client

A table of utility functions for working with Scopes that can be used to speed up the process of writing repository scripts for client objects.

Functions​

getCached​

ScopeUtil.getCached(
scope: Scope,
key: string,
initializer: (
rootScope: any,
utility: any
) → T
) → T

Returns the cache with the given key from the given scope. If not found, the initializer callback will be ran in order to initialize the cache.

Show raw api
{
    "functions": [
        {
            "name": "getCached",
            "desc": "Returns the cache with the given `key` from the given `scope`. If not found,\nthe `initializer` callback will be ran in order to initialize the cache.",
            "params": [
                {
                    "name": "scope",
                    "desc": "",
                    "lua_type": "Scope"
                },
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "initializer",
                    "desc": "",
                    "lua_type": "(rootScope: any, utility: any) -> T"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "T\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 23,
                "path": "mirror/Kit.Utility.ScopeUtil.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "ScopeUtil",
    "desc": "A table of utility functions for working with Scopes that can be used to speed up the process of writing repository scripts for client objects.",
    "realm": [
        "Client"
    ],
    "source": {
        "line": 10,
        "path": "mirror/Kit.Utility.ScopeUtil.luau"
    }
}