Show HN: TinyJs React like framework in 35 lines of code
36 points by atum47 4 days ago | 33 comments
Hi HN, I got to work yesterday and today and came up with a very simple way to create and manage state in TinyJS.
I end up creating a simple App to illustrate how to use the new createState function and custom components in a React like manner. Here's the code for it - https://github.com/victorqribeiro/tinyapp
Here's the PR for the createState function - https://github.com/victorqribeiro/TinyJS/pull/9
chrismorgan 15 hours ago | next |
A comment on code organisation.
https://github.com/victorqribeiro/TinyApp/blob/db92225cfd0ae...:
(Labelling comments mine.)This ordering isn’t great: ① refers to ③, and ④ refers to ②. It’d be better to reorder them, at least to swap ② and ③, and remove the blank line separating ② and ④:
But you really can do much better: At least at this scale, that’s much easier to follow.Inlining can improve other places too (though at larger scales it becomes more debatable):