prodo-dev / prodo

Prodo is a React framework to build apps faster.
https://docs.prodo.dev
MIT License
114 stars 5 forks source link

Add routing and lint #76

Closed tdawes closed 5 years ago

tdawes commented 5 years ago

Sorry about all the linting changes - my IDE applied them automatically.

This is identical to https://github.com/prodo-ai/prodo-kanban/pull/1/files except that it adds a new utility to @prodo/route, matchRoute that matches a route to a slug and extracts the params:

const path = "/a/b/c"
const pattern = "/a/:prop1/:prop2"
const match = matchRoute(path, pattern); // equals {prop1: "b", prop2: "c"};

(see tests here for examples)

and uses this instead of passing the boardId as a prop (see here for an example).