Releases: cxmeel/BasicState
0.2.6
0.2.5
What's Changed
- [wally] Removed Roact as a DevDependency (we're using git submodules for unit tests anyway)
Full Changelog: 0.2.4...0.2.5
0.2.4
What's Changed
- Corrected Roact version and bumped Wally to use the latest by @mkargus in #11
- Bumped version numbers in
wally.toml
and docs/README.md - Fixed version numbers to exact versions in
foreman.toml
- Bumped rojo to v7.0.0
New Contributors
Full Changelog: 0.2.3...0.2.4
0.2.3
0.2.2
0.2.1
This release allows keys to be removed from the state object by using the new State.None
object (issue #4). This works similarly to the @Roblox/Cryo package, which uses the same approach to unset keys from a dictionary.
Example
local State = BasicState.new({
Hello = "World"
})
print(State:Get("Hello")) --> "World"
State:Delete("Hello")
print(State:Get("Hello")) --> nil
State:SetState({
Hello = State.None, -- or BasicState.None
})
print(State:Get("Hello")) --> nil
This release also addresses the warnings produced by Roact, where BasicState was still trying to update a component's state while it was unmounting (issue #5).
0.2.0
What's Changed
- Add State.ProtectType by @boatbomber in #2
New Contributors
- @boatbomber made their first contribution in #2
Full Changelog: v0.1.1...v0.2.0
0.1.1
If you encounter any issues, please submit a new issue via GitHub, or to this thread on the DevForum.
This release now implements deep merging. This means that when you commit tables to the store, you will not lose the original data -- only keys which are specified will be updated.
Also in this release:
- Tables can now be committed to the store.
- Updating a table will fire changed events.
- Tables are now deep merged.
local State = BasicState.new({
Greeting = "Hello",
Locale = {
French = "Salut",
Spanish = "Hola",
Polish = "Dzień dobry"
}
})
State:SetState({
Greeting = "Hi",
Locale = {
Polish = "Cześć"
}
})
--[[
The new state object will look like this:
{
Greeting = "Hi",
Locale = {
French = "Salut",
Spanish = "Hola",
Polish = "Cześć"
}
}
Original data is not lost; only applicable values are updated.
--]]
0.1.0
Roact wrapping is experimental!
This release contains a new experimental feature which allows a BasicState store to be injected into a Roact component.
- BasicState state is injected directly into the Roact component's state
- BasicState instances can be manipulated as normal. State updates will be reflected in the Roact component
- You can choose whether to inject the entire BasicState store into the Roact component, or only specific keys
- No dependency on Roact itself. You can continue to use BasicState without Roact present in your games hieraracy. It overloads components directly, rather than creating new ones, meaning Roact is not required!
This is designed to make global state management in Roact much easier. An example is available under examples/roact-wrapped-counter
.