Skip to main content

BrioUtils

Utility functions affecting Brios.

Functions

clone

BrioUtils.clone(brioBrio<T>) → Brio<T>

Clones a brio, such that it may be killed without affecting the original brio.

aliveOnly

BrioUtils.aliveOnly(brios{Brio<T>}) → {Brio<T>}

Returns a list of alive Brios only

firstAlive

BrioUtils.firstAlive(brios{Brio<T>}) → Brio<T>

Returns the first alive Brio in a list

flatten

BrioUtils.flatten(brioTable{anyBrio<Brio<T> | T>}) → Brio<{T}>

Given a list of brios of brios, flattens that list into a brio with just one T value.

first

BrioUtils.first(
brios{Brio<T>},
...U
) → Brio<U>

Returns a brio that dies whenever the first Brio in the list dies. The value of the Brio is the ... value.

withOtherValues

since 3.6.0
</>
BrioUtils.withOtherValues(
brioBrio<T>,
...U
) → Brio<U>

Clones a brio, such that it may be killed without affecting the original brio.

extend

BrioUtils.extend(
brioBrio<U>,
...T
) → Brio<T>

Makes a brio that is limited by the lifetime of its parent (but could be shorter) and has the new values given.

prepend

since 3.6.0
</>
BrioUtils.prepend(
brioBrio<U>,
...T
) → Brio<T>

Makes a brio that is limited by the lifetime of its parent (but could be shorter) and has the new values given at the beginning of the result

merge

BrioUtils.merge(
brioBrio<{T}>,
otherBrioBrio<{U}>
) → Brio<{T | U}>

Merges the existing brio value with the other brio

Show raw api
{
    "functions": [
        {
            "name": "clone",
            "desc": "Clones a brio, such that it may be killed without affecting the original\nbrio.",
            "params": [
                {
                    "name": "brio",
                    "desc": "",
                    "lua_type": "Brio<T>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Brio<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 20,
                "path": "src/brio/src/Shared/BrioUtils.lua"
            }
        },
        {
            "name": "aliveOnly",
            "desc": "Returns a list of alive Brios only",
            "params": [
                {
                    "name": "brios",
                    "desc": "",
                    "lua_type": "{Brio<T>}"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{Brio<T>}"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 51,
                "path": "src/brio/src/Shared/BrioUtils.lua"
            }
        },
        {
            "name": "firstAlive",
            "desc": "Returns the first alive Brio in a list",
            "params": [
                {
                    "name": "brios",
                    "desc": "",
                    "lua_type": "{Brio<T>}"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Brio<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 67,
                "path": "src/brio/src/Shared/BrioUtils.lua"
            }
        },
        {
            "name": "flatten",
            "desc": "Given a list of brios of brios, flattens that list into a brio with\njust one T value.",
            "params": [
                {
                    "name": "brioTable",
                    "desc": "",
                    "lua_type": "{ any: Brio<Brio<T> | T>}"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Brio<{T}>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 83,
                "path": "src/brio/src/Shared/BrioUtils.lua"
            }
        },
        {
            "name": "first",
            "desc": "Returns a brio that dies whenever the first Brio in the list\ndies. The value of the Brio is the `...` value.",
            "params": [
                {
                    "name": "brios",
                    "desc": "",
                    "lua_type": "{Brio<T>}"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "U"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Brio<U>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 111,
                "path": "src/brio/src/Shared/BrioUtils.lua"
            }
        },
        {
            "name": "withOtherValues",
            "desc": "Clones a brio, such that it may be killed without affecting the original\nbrio.",
            "params": [
                {
                    "name": "brio",
                    "desc": "",
                    "lua_type": "Brio<T>"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "U"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Brio<U>"
                }
            ],
            "function_type": "static",
            "since": "3.6.0",
            "source": {
                "line": 147,
                "path": "src/brio/src/Shared/BrioUtils.lua"
            }
        },
        {
            "name": "extend",
            "desc": "Makes a brio that is limited by the lifetime of its parent (but could be shorter)\nand has the new values given.",
            "params": [
                {
                    "name": "brio",
                    "desc": "",
                    "lua_type": "Brio<U>"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "T"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Brio<T>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 171,
                "path": "src/brio/src/Shared/BrioUtils.lua"
            }
        },
        {
            "name": "prepend",
            "desc": "Makes a brio that is limited by the lifetime of its parent (but could be shorter)\nand has the new values given at the beginning of the result",
            "params": [
                {
                    "name": "brio",
                    "desc": "",
                    "lua_type": "Brio<U>"
                },
                {
                    "name": "...",
                    "desc": "",
                    "lua_type": "T"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Brio<T>"
                }
            ],
            "function_type": "static",
            "since": "3.6.0",
            "source": {
                "line": 209,
                "path": "src/brio/src/Shared/BrioUtils.lua"
            }
        },
        {
            "name": "merge",
            "desc": "Merges the existing brio value with the other brio",
            "params": [
                {
                    "name": "brio",
                    "desc": "",
                    "lua_type": "Brio<{T}>"
                },
                {
                    "name": "otherBrio",
                    "desc": "",
                    "lua_type": "Brio<{U}>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Brio<{T | U}>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 245,
                "path": "src/brio/src/Shared/BrioUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "BrioUtils",
    "desc": "Utility functions affecting Brios.",
    "source": {
        "line": 5,
        "path": "src/brio/src/Shared/BrioUtils.lua"
    }
}