Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoferjoseph authored Mar 31, 2017
1 parent b9ca8eb commit d7881d8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#hash-switch
# hash-switch
This lib is made to give you the same functionality as a `switch` statement but with a more natural API.

###Compare:
### Compare:
```js
switch(expression) {
case 'one':
Expand All @@ -16,7 +16,7 @@ switch(expression) {
}
```

###To:
### To:
```js
hs({
'one':function(){ return 'ONE' },
Expand All @@ -26,10 +26,10 @@ function() { return 'DEFAULT' })
```
For me the second example is a much more familiar syntax and meshes with my other JavaScript more naturally.

##Install
## Install
`npm i hash-switch --save`

##Usage
## Usage
```js
var hs = require('hash-switch')({
'one': function() {return 'ONE'},
Expand Down

0 comments on commit d7881d8

Please sign in to comment.