Closed Satyam closed 10 years ago
This is great and probably something I should have done in the first place. The example app is actually from Leo's blog post here: http://lhorie.github.io/mithril-blog/an-exercise-in-awesomeness.html. I figured it showed enough UI features with minimal Mithril methods, but a good example should go over a broader range of the framework's functions. It's also important to remember that Mithril can be used as sparingly as one desires, since it does not force a convention. So perhaps your example could be put alongside Leo's and this repo could start gathering a handful of more helpful examples.
I like your structure a lot better and the decoupling of the data into JSON is a good example of a real-world use case. Feel free to submit a PR if you want.
I have changed the gist to use routing. With this change, I believe, most Mithril features are covered quite nicely.
I'm afraid I won't be filing a PR, I accept Git is a necessary evil but I try to keep away from it when I have a chance. Feel free to use it as you see fit.
Haha no worries! I may mess around with your code a bit anyway. It looks solid. Thanks for sharing. :)
In trying to learn about Mithril by working on something myself, I changed a little your example app:
https://gist.github.com/Satyam/3f45eb8997f16a56ac79
I think it represents several interesting features of Mithril not included in your current example app such as m.request and m.prop .
I added a task to the gruntfile to copy the json data from the source folder to the distribution.
I mean to add routing to the tabs component so it uses even more of Mithril features. I'll update it when I'm done.