Skip to main content

RemoteFunctionUtils

Utility functions to wrap invoking a remote function with a promise

Functions​

promiseInvokeServer​

RemoteFunctionUtils.promiseInvokeServer(
remoteFunction: RemoteFunction,
...: any
) → Promise<T>

Invokes the server with the remote function call.

promiseInvokeClient​

RemoteFunctionUtils.promiseInvokeClient(
remoteFunction: RemoteFunction,
player: Instance,
...: any
) → Promise<T>

Invokes the client with the remote function call.

promiseInvokeBindableFunction​

RemoteFunctionUtils.promiseInvokeBindableFunction(
bindableFunction: RemoteFunction,
...: any
) → Promise<T>

Invokes the server with the remote function call.

fromPromiseYieldResult​

RemoteFunctionUtils.fromPromiseYieldResult(
ok: boolean,
...: any
) → Promise<T>

Converts a promise result into a promise

Show raw api
{
    "functions": [
        {
            "name": "promiseInvokeServer",
            "desc": "Invokes the server with the remote function call.",
            "params": [
                {
                    "name": "remoteFunction",
                    "desc": "",
                    "lua_type": "RemoteFunction"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 19,
                "path": "src/remotefunctionutils/src/Shared/RemoteFunctionUtils.lua"
            }
        },
        {
            "name": "promiseInvokeClient",
            "desc": "Invokes the client with the remote function call.",
            "params": [
                {
                    "name": "remoteFunction",
                    "desc": "",
                    "lua_type": "RemoteFunction"
                },
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 49,
                "path": "src/remotefunctionutils/src/Shared/RemoteFunctionUtils.lua"
            }
        },
        {
            "name": "promiseInvokeBindableFunction",
            "desc": "Invokes the server with the remote function call.",
            "params": [
                {
                    "name": "bindableFunction",
                    "desc": "",
                    "lua_type": "RemoteFunction"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 82,
                "path": "src/remotefunctionutils/src/Shared/RemoteFunctionUtils.lua"
            }
        },
        {
            "name": "fromPromiseYieldResult",
            "desc": "Converts a promise result into a promise",
            "params": [
                {
                    "name": "ok",
                    "desc": "",
                    "lua_type": "boolean"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 115,
                "path": "src/remotefunctionutils/src/Shared/RemoteFunctionUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "RemoteFunctionUtils",
    "desc": "Utility functions to wrap invoking a remote function with a promise",
    "source": {
        "line": 6,
        "path": "src/remotefunctionutils/src/Shared/RemoteFunctionUtils.lua"
    }
}