lukeed / trouter

:fish: A fast, small-but-mighty, familiar fish...errr, router*
MIT License
634 stars 23 forks source link

Add `all` method #1

Closed lukeed closed 6 years ago

lukeed commented 6 years ago

Should either append to all {METHOD} lists, or every {METHOD} action should look inside all too.

ianwalter commented 6 years ago

Is this what you were thinking for the second option? Add 'all' as a separate method, and then in find() do something like:

let arr = match(url, [...this.routes[method], ...this.routes['all']])
lukeed commented 6 years ago

Yup, effectively! I added this in a branch last week. About to roll it out for Polka@0.4

Trying to do a few things at once in that release.