Fusion icon indicating copy to clipboard operation
Fusion copied to clipboard

ForValues inconsistency

Open Matheo-LESNE opened this issue 1 year ago • 1 comments

Greetings,

I was going through the user docs for v0.3 but encountered difficulty understanding the reasoning behind the order of the returned values of ForValues. I used the code provided in the docs:

local Fusion = require(game.ReplicatedStorage.Fusion)
local scoped = Fusion.scoped
local scope = scoped(Fusion)

local words = scope:Value({"Orange", "Red", "Magenta"})

local lengths = scope:ForValues(words, function(use, scope, word)
    return #word
end)

print(scope.peek(lengths)) --> {6, 3, 7}

scope:doCleanup()

I ran the code multiple times, but got a different print every time while the input table didn't change. Is this the intended behaviour ?

image

Thanks for the great library, and keep up the good work.

Rgds, Mathéo

Matheo-LESNE avatar May 24 '24 00:05 Matheo-LESNE

This is a known issue; should be fixed by #323

dphfox avatar May 26 '24 05:05 dphfox