Allow additional arguments for the UpdateAsync Callback Function

As a Roblox developer, it is currently too hard to handle additional parameters to be used within the CallBack Function indicated for the UpdateAsync.

UpdateAsync Callback Function has only 2 arguments:

Additional arguments have to be taken from higher scopes. Example:

local MyValue1 = 1 -- additional argument (outside)
local MyValue2 = 2 -- additional argument (outside)

local function MyFunction(CurrentValue, keyInfo)
    return CurrentValue + MyValue1 - MyValue2
end

MyStore:UpdateAsync("User_1234", MyFunction)

The correct thing would be to have these additional arguments declared in the function:

local function MyFunction(CurrentValue, keyInfo, MyValue1, MyValue2)
    return CurrentValue + MyValue1 - MyValue2
end

MyStore:UpdateAsync("User_1234", MyFunction, 1, 2) -- additional arguments 

If Roblox is able to address this issue, it would improve my development experience because this will make UpdateAsync more intuitive and secure.

5 Likes

We will look into this feature request.

2 Likes