Today I would like to do some advertising. Do you know
Flems.io ?
Flems.io is a simple, but very smart prototyping platform ideal for testing oder demonstration of HTML/CSS/Javascript or even Typescript. Ok, simple might not be the right wording, it´s just super simple to use. Under the hood, it provides quite a lot:
Flems supports TypeScript, LiveScript and Babel (standalone) compilation too. You can add CSS & JS dependencies by specifying a full URL pointing to the desired file, or by giving a reference to an NPM package (and optional path) - these will be taken from unpkg.com (See the documentation for more info.)
Flems.io is similar to online editors like CodePen or JSFiddle, but has one unique selling point. You do not need an account or any external memory: Flems.io stores all data in the URL!. This is ideal for short tests and demos provided on dev.to or other online media.
Flems-URL´s can get quite long as they store all information + page settings, so you might push the limits using windows desktop links, which are limited to 256 characters. But using Flems-URL´s on online platforms like dev.to is usually not a problem. Unlike other platforms Flems.io does not require any initialization, so it is up and running in no time. It´s best usable for short demos or just for a quick test of some lines of code.
Here is an example, i alredy provided here
Happy coding!
Top comments (7)
Hy Eckehard,
Yes it's a great tool, written in Mithril
Oh, didn´t know this.
Mithril is nice and it has some very interesting features. It just features pretty much the same approach like VanJS. They compose the DOM by composing functions manually, which is very similar to composing the DOM by composing HTML.
I prefer an approach where you can control DOM composition using Javascript. Think of elements that are built differently depending on current conditions like screen width, day time or whatever.
But I should definitively dig a bit deeper into Mithril.
It is my first beloved library :-)
Here is an example I posted 4 years ago :
Hall of Fame
Thank you for the example. Currently my time is a limited, but I´ll try to rebuild this page in DML to see, if it is really an advantage to have some kind of view controller. In my oppinion it is not, but I´m always curious to learnnew things.
You are right, sadly time is limited.
Mithril does not impose to return view method in every component .
Look at this very simplified example
Demo
Is there any reason you used an external function for increment?
It feels more convenient to me to use functions instead of string constants, ending with the same syntax like VanJS or DML (For sure it would be easy to use some kind of "generator" to simplify the creation).
Building DOM elements as nested object is a pretty common approach, but it feels a bit limiting to me, as you cannot use advanced programming methods to build your objects. I would tend to create UI-Elements using generator functions or class methods, that implement some common behavior.
No there is abolutely no reason, just a personal choice.
Of course, "generator" are also py preferred choice.
Mithril, is a very nice and mature framework :-)