Skip to main content

BaseDispatcher

Functions

new

BaseDispatcher.new() → BaseDispatcher

Create a new dispatcher. This should NOT be called directly on the base dispatcher unless you are creating your own dispatcher.

is

BaseDispatcher.is(objT) → bool

Check if the passed obj is a dispatcher, this can be either the BaseDispatcher or any class which extends BaseDispatcher.

collectFunctions

BaseDispatcher:collectFunctions(namestring) → {() → ()}

Returns all function on services which have the passed name.

dispatch

BaseDispatcher:dispatch(
namestring,
...any
) → ()

This is the method which is called by a lifecycle to actually call all the functions.

Show raw api
{
    "functions": [
        {
            "name": "collectFunctions",
            "desc": "Returns all function on services which have the passed `name`.",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ () -> () }"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 24,
                "path": "packages/sapling/source/classes/BaseDispatcher.luau"
            }
        },
        {
            "name": "dispatch",
            "desc": "This is the method which is called by a lifecycle to actually call all the functions.",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 36,
                "path": "packages/sapling/source/classes/BaseDispatcher.luau"
            }
        },
        {
            "name": "new",
            "desc": "Create a new dispatcher. This should NOT be called directly on the base dispatcher unless you are creating\nyour own dispatcher.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "BaseDispatcher"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 48,
                "path": "packages/sapling/source/classes/BaseDispatcher.luau"
            }
        },
        {
            "name": "is",
            "desc": "Check if the passed `obj` is a dispatcher, this can be either the [BaseDispatcher] or any class which extends [BaseDispatcher].",
            "params": [
                {
                    "name": "obj",
                    "desc": "",
                    "lua_type": "T"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "bool"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 62,
                "path": "packages/sapling/source/classes/BaseDispatcher.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "BaseDispatcher",
    "desc": "",
    "source": {
        "line": 6,
        "path": "packages/sapling/source/classes/BaseDispatcher.luau"
    }
}