url
url copied to clipboard
Clean up Example.elm
There were a couple of problems in examples/Example.elm that I wanted to help out with:
- Not well commented, these kind of example programs are extremely helpful for learning the way things work, having both the code (example program) and documentation (comments) in one place and linked to each other is a powerful tool for understanding a new library. It's not a necessity, but in my opinion it can really help.
- The use of
Debug.toString, which is not considered suitable for production use (afaik at least by the community). I wrote arouteToStringfunction instead, which does add some boilerplate, but I think that the use ofDebug.toStringshould be discouraged. On the other hand, the history tab is, in a way, debugging. I'm open to changing it or not, but I do think thatDebug.toStringshould be, as previously mentioned, discouraged. - A typo (
"Uknown URL")
These are all things that aren't major issues, and a lot of it is somewhat opinionated on my behalf. I'm more than happy to drop some (or all) of them, but I really do think this could help out.