We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When dispatching SiloUtil.None in a combined silo, it does not remove the value from the state.
SiloUtil.None
Single Silo:
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Silo = require(ReplicatedStorage.Packages.Silo) local SiloUtil = require(ReplicatedStorage.Packages._Index["[email protected]"].silo.Util) local initialState = { myValue = 123, } local mySilo = Silo.new(initialState, { Set = function(state, action) state.myValue = action.value end, }) mySilo:Watch(function(state) return state end, function(objects) print(objects) end) task.wait(1) print("Set Empty") mySilo:Dispatch(mySilo.Actions.Set({ value = SiloUtil.None }))
Final Output: {}
{}
Combined Silo:
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Silo = require(ReplicatedStorage.Packages.Silo) local SiloUtil = require(ReplicatedStorage.Packages._Index["[email protected]"].silo.Util) local initialState = { myValue = 123, } local mySilo = Silo.new(initialState, { Set = function(state, action) state.myValue = action.value end, }) local MAIN = Silo.combine({ mySilo = mySilo, }) MAIN:Watch(function(state) return state.mySilo end, function(objects) print(objects) end) task.wait(1) print("Set Empty") MAIN:Dispatch(mySilo.Actions.Set({ value = SiloUtil.None }))
Final Output: {myValue = 123} Expected output: {}
{myValue = 123}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When dispatching
SiloUtil.None
in a combined silo, it does not remove the value from the state.Single Silo:
Final Output:
{}
Combined Silo:
Final Output:
{myValue = 123}
Expected output:
{}
The text was updated successfully, but these errors were encountered: