Skip to main content

Counter

Functions

new

Counter.new() → Counter

Creates a new counter

GetValue

Counter:GetValue() → number

Returns the current count

Observe

Counter:Observe() → number

Observes the current count

Add

Counter:Add(amountnumber | Observable<number>) → MaidTask

Adds an amount to the counter.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Creates a new counter",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Counter"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 21,
                "path": "src/counter/src/Shared/Counter.lua"
            }
        },
        {
            "name": "GetValue",
            "desc": "Returns the current count",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 37,
                "path": "src/counter/src/Shared/Counter.lua"
            }
        },
        {
            "name": "Observe",
            "desc": "Observes the current count",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 46,
                "path": "src/counter/src/Shared/Counter.lua"
            }
        },
        {
            "name": "Add",
            "desc": "Adds an amount to the counter.",
            "params": [
                {
                    "name": "amount",
                    "desc": "",
                    "lua_type": "number | Observable<number>"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "MaidTask"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 57,
                "path": "src/counter/src/Shared/Counter.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Counter",
    "desc": "",
    "source": {
        "line": 4,
        "path": "src/counter/src/Shared/Counter.lua"
    }
}