i would love your opinion on this simple and dynamic JavaScript router that i use for my Single Page Application. I find it easy, simple, light and effective.
/*
* USAGE
* https://jsfiddle.net/mckabue/knwvsy3t/18/
*
* var $router = ROUTER(['/home/{tag}?gh={gh}']);
* var $match = $router.match('/home/a tag?gh=dfe');
* console.log($match); //{tag: "a tag", gh: "dfe"}
*
*/
https://jsfiddle.net/mckabue/knwvsy3t/18/
Top comments (3)
You could write it in typescript, abstract things in classes and improve readability 😊
Thanks... Will definitely do that
Typescript is f*ing awesome 😁