Repository navigation
Releases: veternitzz/switch-luau
Release list
v2.1.1
Release Notes
Decided to create a type for statement operators to streamline the process for creating new operators in :Case(). I also decided to make the process for checking the operation and returning based off of it more isolated.
What's new
New internal class to hold internal functions (is not returned by the module)
New Internal.StatementCheck() function to streamline the process of checking statement operators
Changes
Uses StatementOperator type to streamline the creation of new statement operators
v2.1.0
Release Notes
Hey y'all! 2.1.0 is finally out bringing daisy chaining and more to the module. v2.2.0 is coming soon which will bring the FollowThrough function. I'm glad someone implemented daisy chaining faster than I did because it overall makes your code much cleaner which was a key issue with this module for many people. I can now confidently say that your code should be much cleaner and easier to follow with this module by using daisy chaining.
Docs may not be fully up to date as I plan to make a dedicated documentation site as I believe it is much cleaner than our current system. I'm having an issue making the Roblox Package for sale, but I'll try to get that resolved ASAP.
What's new
- Add daisychaining, tests, and docs by @Sparkypen7 in #4
- Added new
>=and<=operators to:Case - Internal changes to improve the speed of the module
New Contributors
- @Sparkypen7 made their first contribution in #4
Daisychaining
For those who don't know, daisy chaining looks like this (using our module as an example):
local a = 10
Switch.new(a)
:Case(25, "==", function()
print("Hello world!"
endThis means you no longer have to define a variable when starting a new switch which should solve the issue with the code looking messy.
Installation
1) Via github releases
Download the .rbxl file attached to this release and load it into studio.
2) Via wally
Use wally by adding switch = "veternitzz/switch@2.1.0" to your wally.toml file.
Full Changelog: 2.0.0...2.1.0
v2.0.0
Release Notes
This was supposed to be v1.1.0, but I decided to just rewrite the entire module. So, due to the rules of semantic versioning, this is major release 2.
What's new
- Introduced a switch class instead of just returning the functions
- Rewrote the
:Case()method to support different operations (i.e. ~=, ==, >, <)
Fixes
- The
:Default()method can no longer have duplicates and will error out if you attempt to have multiple per constructor
Wally install: veternitzz/switch@2.0.0
v1.0.0
The initial release, not much to say. README.md will be pushed soon.