Skip to main content

RxInstanceUtils

Utility functions to observe the state of Roblox. This is a very powerful way to query Roblox's state.

tip

Use RxInstanceUtils to program streaming enabled games, and make it easy to debug. This API surface lets you use Roblox as a source-of-truth which is very valuable.

Functions

observeProperty

RxInstanceUtils.observeProperty(
instanceInstance,
propertyNamestring
) → Observable<T>

Observes an instance's property

observeAncestry

RxInstanceUtils.observeAncestry(instanceInstance) → Observable<Instance>

Observes an instance's ancestry

observeFirstAncestorBrio

RxInstanceUtils.observeFirstAncestorBrio(
instanceInstance,
classNamestring
) → Observable<Brio<Instance>>

Observes an instance's ancestry with a brio

observeParentBrio

RxInstanceUtils.observeParentBrio(instanceInstance) → Observable<Brio<Instance>>

Observes the parent of the instance as long as it exists. This is very common when initializing parent interfaces or other behaviors using binders.

observeFirstAncestor

RxInstanceUtils.observeFirstAncestor(
instanceInstance,
classNamestring
) → Observable<Instance?>

Observes an instance's ancestry

observePropertyBrio

RxInstanceUtils.observePropertyBrio(
instanceInstance,
propertyNamestring,
predicate((valueT) → boolean)?--

Optional filter

) → Observable<Brio<T>>

Returns a brio of the property value

observeLastNamedChildBrio

RxInstanceUtils.observeLastNamedChildBrio(
parentInstance,
classNamestring,
namestring
) → Observable<Brio<Instance>>

Observes the last child with a specific name.

observeChildrenOfNameBrio

RxInstanceUtils.observeChildrenOfNameBrio(
parentInstance,
classNamestring,
namestring
) → Observable<Brio<Instance>>

Observes the children with a specific name.

observeChildrenOfClassBrio

RxInstanceUtils.observeChildrenOfClassBrio(
parentInstance,
classNamestring
) → Observable<Instance>

Observes all children of a specific class

observeChildrenBrio

RxInstanceUtils.observeChildrenBrio(
parentInstance,
predicate((valueInstance) → boolean)?--

Optional filter

) → Observable<Brio<Instance>>

Observes all children

observeDescendants

RxInstanceUtils.observeDescendants(
parentInstance,
predicate((valueInstance) → boolean)?--

Optional filter

) → Observable<Instance,boolean>

Observes all descendants that match a predicate

observeDescendantsBrio

RxInstanceUtils.observeDescendantsBrio(
parentInstance,
predicate((valueInstance) → boolean)?--

Optional filter

) → Observable<Brio<Instance>>

Observes all descendants that match a predicate as a brio

observeDescendantsOfClassBrio

RxInstanceUtils.observeDescendantsOfClassBrio(
parentInstance,
classNamestring
) → Observable<Instance>

Observes all descendants of a specific class

Show raw api
{
    "functions": [
        {
            "name": "observeProperty",
            "desc": "Observes an instance's property",
            "params": [
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "propertyName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 32,
                "path": "src/instanceutils/src/Shared/RxInstanceUtils.lua"
            }
        },
        {
            "name": "observeAncestry",
            "desc": "Observes an instance's ancestry",
            "params": [
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Instance>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 52,
                "path": "src/instanceutils/src/Shared/RxInstanceUtils.lua"
            }
        },
        {
            "name": "observeFirstAncestorBrio",
            "desc": "Observes an instance's ancestry with a brio",
            "params": [
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "className",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<Instance>>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 67,
                "path": "src/instanceutils/src/Shared/RxInstanceUtils.lua"
            }
        },
        {
            "name": "observeParentBrio",
            "desc": "Observes the parent of the instance as long as it exists. This is very common when\ninitializing parent interfaces or other behaviors using binders.",
            "params": [
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<Instance>>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 105,
                "path": "src/instanceutils/src/Shared/RxInstanceUtils.lua"
            }
        },
        {
            "name": "observeFirstAncestor",
            "desc": "Observes an instance's ancestry",
            "params": [
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "className",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Instance?>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 118,
                "path": "src/instanceutils/src/Shared/RxInstanceUtils.lua"
            }
        },
        {
            "name": "observePropertyBrio",
            "desc": "Returns a brio of the property value",
            "params": [
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "propertyName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "predicate",
                    "desc": "Optional filter",
                    "lua_type": "((value: T) -> boolean)?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<T>>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 147,
                "path": "src/instanceutils/src/Shared/RxInstanceUtils.lua"
            }
        },
        {
            "name": "observeLastNamedChildBrio",
            "desc": "Observes the last child with a specific name.",
            "params": [
                {
                    "name": "parent",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "className",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<Instance>>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 195,
                "path": "src/instanceutils/src/Shared/RxInstanceUtils.lua"
            }
        },
        {
            "name": "observeChildrenOfNameBrio",
            "desc": "Observes the children with a specific name.",
            "params": [
                {
                    "name": "parent",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "className",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<Instance>>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 249,
                "path": "src/instanceutils/src/Shared/RxInstanceUtils.lua"
            }
        },
        {
            "name": "observeChildrenOfClassBrio",
            "desc": "Observes all children of a specific class",
            "params": [
                {
                    "name": "parent",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "className",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Instance>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 301,
                "path": "src/instanceutils/src/Shared/RxInstanceUtils.lua"
            }
        },
        {
            "name": "observeChildrenBrio",
            "desc": "Observes all children",
            "params": [
                {
                    "name": "parent",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "predicate",
                    "desc": "Optional filter",
                    "lua_type": "((value: Instance) -> boolean)?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<Instance>>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 317,
                "path": "src/instanceutils/src/Shared/RxInstanceUtils.lua"
            }
        },
        {
            "name": "observeDescendants",
            "desc": "Observes all descendants that match a predicate",
            "params": [
                {
                    "name": "parent",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "predicate",
                    "desc": "Optional filter",
                    "lua_type": "((value: Instance) -> boolean)?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Instance, boolean>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 352,
                "path": "src/instanceutils/src/Shared/RxInstanceUtils.lua"
            }
        },
        {
            "name": "observeDescendantsBrio",
            "desc": "Observes all descendants that match a predicate as a brio",
            "params": [
                {
                    "name": "parent",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "predicate",
                    "desc": "Optional filter",
                    "lua_type": "((value: Instance) -> boolean)?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Brio<Instance>>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 390,
                "path": "src/instanceutils/src/Shared/RxInstanceUtils.lua"
            }
        },
        {
            "name": "observeDescendantsOfClassBrio",
            "desc": "Observes all descendants of a specific class",
            "params": [
                {
                    "name": "parent",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "className",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<Instance>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 426,
                "path": "src/instanceutils/src/Shared/RxInstanceUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "RxInstanceUtils",
    "desc": "Utility functions to observe the state of Roblox. This is a very powerful way to query\nRoblox's state.\n\n:::tip\nUse RxInstanceUtils to program streaming enabled games, and make it easy to debug. This API surface\nlets you use Roblox as a source-of-truth which is very valuable.\n:::",
    "source": {
        "line": 12,
        "path": "src/instanceutils/src/Shared/RxInstanceUtils.lua"
    }
}