Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Releases: cxmeel/BasicState

0.2.6

31 Jan 20:36
Compare
Choose a tag to compare

What's Changed

  • [wally] Remove all Dev Dependencies

Full Changelog: 0.2.5...0.2.6

0.2.5

31 Jan 20:25
Compare
Choose a tag to compare
0.2.5 Pre-release
Pre-release

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

31 Jan 20:12
a3795d4
Compare
Choose a tag to compare
0.2.4 Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: 0.2.3...0.2.4

0.2.3

04 Nov 20:43
Compare
Choose a tag to compare

What's Changed

  • Add State:Reset() method, and State:SetState() now also accepts a callback by @Gaffal in #8
  • Added support for wally, as requested by @mkargus in #9

New Contributors

  • @Gaffal made their first contribution in #8

Full Changelog: 0.2.2...0.2.3

0.2.2

17 May 20:08
Compare
Choose a tag to compare

What's Changed

  • Add State:__tostring() by @rimuy in #6
  • Added TestEZ spec file for automated CI

New Contributors

  • @rimuy made their first contribution in #6

Full Changelog: v0.2.1...0.2.2

0.2.1

13 Nov 17:01
Compare
Choose a tag to compare

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

03 Sep 19:34
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.1.1...v0.2.0

0.1.1

27 Aug 21:19
18d1281
Compare
Choose a tag to compare

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

25 Aug 14:35
Compare
Choose a tag to compare

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.

0.0.4

03 Aug 15:06
Compare
Choose a tag to compare

In this release

  • New React-style SetState method, which allows multiple values to be set at once
  • Changed behaviour of Set to internally use RawSet for setting/modifying values in the store

See the docs for documentation, examples and warnings on this method.