Skip to main content

TableClientReplicator

This item only works when running on the client. Client

Inherits from BaseTableReplicator

warning

You must call TableClientReplicator.requestServerData() in order to begin replication to the client. It should only be called ideally once and after all listeners have been registered.

Functions

listenForNewReplicator

TableClientReplicator.listenForNewReplicator(
classTokenNamestring,
fn(replicatorTableClientReplicator) → ()
) → () → ()

Listens for a new TableClientReplicator of the given ClassName.

requestServerData

TableClientReplicator.requestServerData() → Promise

Requests all the existing replicators from the server. This should only be called once, calling it multiple times will return the same promise. All replicator listeners should be registered before calling this method.

Show raw api
{
    "functions": [
        {
            "name": "bind",
            "desc": "Binds the given table to a TableClientReplicator ClassName.",
            "params": [
                {
                    "name": "tblOrStr",
                    "desc": "",
                    "lua_type": "table | string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "table\n"
                }
            ],
            "function_type": "static",
            "private": true,
            "unreleased": true,
            "source": {
                "line": 86,
                "path": "src/tablereplicator/src/Client/TableClientReplicator.lua"
            }
        },
        {
            "name": "_newReplicator",
            "desc": "The TCR constructor. is private because it should not be called externally.",
            "params": [
                {
                    "name": "config",
                    "desc": "",
                    "lua_type": "{\n    Id: Id;\n    Parent: TableClientReplicator?;\n    TableManager: TableManager;\n    ClassTokenName: string?;\n    Tags: Tags?;\n}"
                }
            ],
            "returns": [],
            "function_type": "static",
            "private": true,
            "source": {
                "line": 124,
                "path": "src/tablereplicator/src/Client/TableClientReplicator.lua"
            }
        },
        {
            "name": "new",
            "desc": "This method exists to catch people trying to do something they shouldnt.",
            "params": [
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [],
            "function_type": "static",
            "private": true,
            "source": {
                "line": 162,
                "path": "src/tablereplicator/src/Client/TableClientReplicator.lua"
            }
        },
        {
            "name": "listenForNewReplicator",
            "desc": "Listens for a new TableClientReplicator of the given ClassName.",
            "params": [
                {
                    "name": "classTokenName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "fn",
                    "desc": "",
                    "lua_type": "(replicator: TableClientReplicator) -> ()"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "() -> ()"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 170,
                "path": "src/tablereplicator/src/Client/TableClientReplicator.lua"
            }
        },
        {
            "name": "Destroy",
            "desc": "Overrides the default Destroy method to prevent the user from destroying",
            "params": [],
            "returns": [],
            "function_type": "method",
            "private": true,
            "source": {
                "line": 185,
                "path": "src/tablereplicator/src/Client/TableClientReplicator.lua"
            }
        },
        {
            "name": "_Destroy",
            "desc": "This is the actual Destroy method.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "private": true,
            "source": {
                "line": 193,
                "path": "src/tablereplicator/src/Client/TableClientReplicator.lua"
            }
        },
        {
            "name": "requestServerData",
            "desc": "Requests all the existing replicators from the server. This should only\nbe called once, calling it multiple times will return the same promise.\nAll replicator listeners should be registered before calling this method.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 304,
                "path": "src/tablereplicator/src/Client/TableClientReplicator.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "TableClientReplicator",
    "desc": "Inherits from [BaseTableReplicator](#BaseTableReplicator)\n\n:::warning\nYou must call `TableClientReplicator.requestServerData()` in order to begin\nreplication to the client. It should only be called ideally once and after\nall listeners have been registered.\n:::",
    "realm": [
        "Client"
    ],
    "source": {
        "line": 15,
        "path": "src/tablereplicator/src/Client/TableClientReplicator.lua"
    }
}