Let's see: website consists in its entirety of two not-very-illuminating code samples. The documentation on github consists of the phrase "Documentation is a bit lacking yet, please check out the source for now." I feel like at this point, when there are so many, so so many, javascript frameworks to choose from, if you're going to build yet another one you need to take the time to explain why it exists. What are the…
RE:DOM – Tiny DOM library
81–84 of 84 posts
Re: RE:DOM – Tiny DOM library
#82Earlier quoted context omitted.
Toggling visibility (and other stuff) is best done by changing classes on the element.
I think you should consider the trade-off. If you toggle visibility with CSS, you still have to put everything in the DOM. Sometimes, putting things in DOM can be very expensive. Consider a date picker, a fairly complicated thing with many sub-elements. If you have to put thousands of date pickers in the dom, that's going to take a lot of time. Especially if the user only sees one if they click on an event to edit it…
Re: RE:DOM – Tiny DOM library
#83Earlier quoted context omitted.
el.email = Object.assign(document.createElement('input'),{type:'email'});
el.email = { document.createElement('input'), ...{ type: 'email' }}
Re: RE:DOM – Tiny DOM library
#84Earlier quoted context omitted.
el.email = { document.createElement('input'), ...{ type: 'email' }}
I know about the spread operator, but I'm pretty sure that's invalid. `var foo = { document.createElement('input') };` doesn't work, spread or no spread after it.
If anything it should be `var email = {...document.createElement('input'), type: 'email'}`
But that would result in `Object.assign({}, document.createElement('input'), { type: 'email' })`
Got 4 up votes though..