Skip to content

Commit da5feba

Browse files
committed
Added actual readme content
1 parent 7aabd02 commit da5feba

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
11
# switch.lua
2-
Lua implementation of a switch statement
2+
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+
end,
15+
[switch.default] = function(value)
16+
...
17+
end
18+
})
19+
```

0 commit comments

Comments
 (0)