Currently, groups can't store initial keys on construction/creation, so developers often have to do something very hacky like this:
local function createGroup(initalState, setProcessor)
local group = Group(setProcessor)
for key, state do in initalState do
group:setKey(key, state)
end
return group
end
createGroup({
key1 = "state1",
key2 = "state2"
}, AlwaysTrue)
This can create general confusion between projects (as the implementations of createGroup can include a lot of side effects) and requires external dependencies to perform such a primitive task.
The desired API for said feature is very similar to createGroup, which is to pass a table that contains the initial state, and a set processor.
Currently, groups can't store initial keys on construction/creation, so developers often have to do something very hacky like this:
This can create general confusion between projects (as the implementations of
createGroup
can include a lot of side effects) and requires external dependencies to perform such a primitive task.The desired API for said feature is very similar to
createGroup
, which is to pass a table that contains the initial state, and a set processor.