We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7aabd02 commit da5febaCopy full SHA for da5feba
README.md
@@ -1,2 +1,19 @@
1
# switch.lua
2
-Lua implementation of a switch statement
+Lua implementation of a switch statement. Supports an optional default case.
3
+
4
+## Example
5
+```lua
6
+local switch = require 'switch'
7
8
+switch('lua', {
9
+ goodbye = function(value)
10
+ ...
11
+ end,
12
+ hello = function(value)
13
14
15
+ [switch.default] = function(value)
16
17
+ end
18
+})
19
+```
0 commit comments