Skip to content

Commit

Permalink
fixed missing "scope" parameter in For docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tapple committed Jun 2, 2024
1 parent 9772c07 commit d268b2c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/tutorials/tables/forkeys.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ It supports both constants and state objects.
local data = {Red = "foo", Blue = "bar"}
local prefix = scope:Value("Key_")

local renamed = scope:ForKeys(data, function(use, key)
local renamed = scope:ForKeys(data, function(use, scope, key)
return use(prefix) .. key
end)

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tables/forvalues.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ It supports both constants and state objects.
local numbers = {1, 2, 3, 4, 5}
local multiplier = Value(2)

local multiplied = ForValues(numbers, function(use, num)
local multiplied = ForValues(numbers, function(use, scope, num)
return num * use(multiplier)
end)

Expand Down
2 changes: 1 addition & 1 deletion src/State/ForKeys.luau
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ local function ForKeys<KI, KO, V, S>(
destructor: unknown?
): Types.For<KO, V>
if typeof(inputTable) == "function" then
External.logError("scopeMissing", nil, "ForKeys", "myScope:ForKeys(inputTable, function(scope, use, key) ... end)")
External.logError("scopeMissing", nil, "ForKeys", "myScope:ForKeys(inputTable, function(use, scope, key) ... end)")
elseif destructor ~= nil then
External.logWarn("destructorRedundant", "ForKeys")
end
Expand Down
2 changes: 1 addition & 1 deletion src/State/ForPairs.luau
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ local function ForPairs<KI, KO, VI, VO, S>(
destructor: unknown?
): Types.For<KO, VO>
if typeof(inputTable) == "function" then
External.logError("scopeMissing", nil, "ForPairs", "myScope:ForPairs(inputTable, function(scope, use, key, value) ... end)")
External.logError("scopeMissing", nil, "ForPairs", "myScope:ForPairs(inputTable, function(use, scope, key, value) ... end)")
elseif destructor ~= nil then
External.logWarn("destructorRedundant", "ForPairs")
end
Expand Down
2 changes: 1 addition & 1 deletion src/State/ForValues.luau
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ local function ForValues<K, VI, VO, S>(
destructor: unknown?
): Types.For<K, VO>
if typeof(inputTable) == "function" then
External.logError("scopeMissing", nil, "ForValues", "myScope:ForValues(inputTable, function(scope, use, value) ... end)")
External.logError("scopeMissing", nil, "ForValues", "myScope:ForValues(inputTable, function(use, scope, value) ... end)")
elseif destructor ~= nil then
External.logWarn("destructorRedundant", "ForValues")
end
Expand Down

0 comments on commit d268b2c

Please sign in to comment.