Skip to content
This repository was archived by the owner on Aug 12, 2024. It is now read-only.

Releases: veternitzz/switch-luau

v2.1.1

Choose a tag to compare

@veternitzz veternitzz released this 03 Aug 03:10

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

Choose a tag to compare

@veternitzz veternitzz released this 02 Aug 01:40

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

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!"
        end

This 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

Choose a tag to compare

@veternitzz veternitzz released this 26 Jul 02:50

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

Choose a tag to compare

@veternitzz veternitzz released this 16 Jul 01:44
3a5da6a

The initial release, not much to say. README.md will be pushed soon.