Dcoder
Відкрити в Telegram
Software developer
Показати більшеКраїна не вказанаКатегорія не вказана
476
Підписники
+124 години
+307 днів
+4230 днів
Архів дописів
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.