Skip to content

New table function, ForRange #429

@TaylorsRus

Description

@TaylorsRus

Fusion is currently lacking a function which covers for Count = 1, X do. Alternatives we're stuck with look something like this

Scope:Computed(function()
    local Table = {}
    for Count = 1, 1, 1 do
        table.insert(Table, Scope:New("")({})
    end
end)

Thus, im proposing syntax along these lines, to serve as utility, while also allowing fusion to add optimizations which a Computed can currently not serve, such as not recreating Children when a new one is added, since currently a computed would recreate every instance if the End state was turned from say, 1 to 2.

Scope:ForRange({Start: number, End: number, Increment: number?}, function(Current: number)
    return Scope:New("")({})    
end)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions