Switch case for actions
npm install @action-land/matchA switch case for actions.
```
npm i @action-land/match
Exposes a single match() function that —
1. Accepts two arguments — default and spec.default
2. is a function that accepts the action and can return anything.spec
3. is an object where key is action.type and value is a function.action.type
4. On a successful match of the corresponding function is called with the action.value.
`ts
import {action} from '@action-land/core'
import {match} from '@action-land/match'
const fn = match(i => i, {
inc: i => i + 1,
dec: i => i - 1
})
fn(action('inc', 10)) // returns 11
``