dev-resources.site
for different kinds of informations.
Why I use MVU ?
Published at
9/28/2022
Categories
mvu
Author
artydev
Main Article
Categories
1 categories in total
mvu
open
Author
7 person written this
artydev
open
Again, MVU is a lighter version of DML with some addons.
I like using MVU because of all the niceties I can write.
Suppose you want a function which allows to insert variable lines break in your component.
Here is how to accomplish this with MVU (Javascript :-))
const {dom, udom, m, render } = MVU;
let div = m("div")
let br = m("br")
let hr = m("hr")
let nbr = (n = 1) => [...Array(n)].map(br)
function MyComponent () {
let view = dom() // we wrap our component in a div
div("I am followed by one line break")
nbr()
hr()
div("I am followed by 5 lines break")
nbr(5)
hr()
udom() // enf of wrapping
return view
}
render(app, MyComponent())
You can test it here : NBR
mvu Article's
13 articles in total
VanJS and a spice of DML, my Holy Graal Quest is finished...
read article
MVU update
read article
A Color Chooser in 64 lines of JS with MVU
read article
A Very Simple Game in plain JS
read article
Create a very simple State Machine with closures
read article
Why I use MVU ?
currently reading
The state of MVU
read article
Morphdom and MVU, don't overlook this !
read article
Readable vs Workable Code
read article
Organizing MVU Projects
read article
Life after Elm: What we did
read article
ClojureScript MVU routing
read article
ClojureScript async MVU
read article
Featured ones: