Dcoder
Open in Telegram
Software developer
Show moreThe country is not specifiedThe category is not specified
476
Subscribers
+124 hours
+307 days
+4230 days
Posts Archive
476
Repost from Mo' tries
Aight aight, there is this lil thing I made that am proud of lowkey.
It's a react router style routing lib for kotlin. Written in pure kotlin so you can use it anywhere.
It uses the builder pattern, you basically add your routes and the final .build() function makes a readonly prefix tree.
The reason we have a prefix tree (or Trie) is because we want a data structure that can look at a route like
/home/apps/me and select from the routes under each one (home, apps and me) the correct one.
Generally, when you see tree data structures in the wild, they usually solve a multiplexing problem (choosing one option out of many).
It's pretty neat, I used TDD for it.