match-default
Pass in a string, and object contain functions that could possibly match string + a default function denoted with the _ key. Made because I think this looks really nice with redux, semi inspired by the pattern matching implementation in Rust.
use
npm i --save match-default
;const data = ;
Currying
The function can also be curried by passing in a single argument of an object. A function will be returned expecting a single argument of a string to match against the provided object.
;const matcher = ;const myMatch = ;console //myMatch === 'wow'