Closed thipages closed 5 years ago
This is a little confusing. There are several recursive calls to "MOD.mount( x )" If there are multiple childs inside childs it probably goes around.
The recursive MOD.mount(x) seem ok. The question is more about data.mount
and data.mountMap
It seems to me that they are not used.
Another way to describe my question is looking at this array in the verify method
var array = [ "html", "mount", "mountMap", "mounts", "tag" ]
My question is when does the verify method catches "mount" or "mountMap" or "mounts"
I have not more checked what is used or not. In the next refactoring I can see this. Thanks for the note.
Before there were several ways to do the same thing. Like:
var h = DOM.mounts
var x = h(x,y, h(x,y h(x,y ) ) )
$("id").append(x)
I then simplified it to DOM.add
If (data.mount) is not used, it must be because I started using mountMap to object that has childs.
This array is used to remove these attributes from the HTML markup.
var array = [ "html", "mount", "mountMap", "mounts", "tag" ]
The exact representation of the object would look like this in the DOM:
<div id="element" tag="div" html="other_content" mountMap="other_content"></div>
Then are removed. Because only matters:
<div id="element"></div>
Note also that I do not use methods:
document.createElement("BUTTON");
document.createTextNode("CLICK ME");
I create HTML from scratch using strings "<+tag+>name</+tag+>"
Anyway I like the way you manage so simply html via js and I am currently testing it in different configurations. There will be a time for code speed optimization. Creating tags from scratch may be the fatest way, I dont know ....
This part of performance testing I do not understand much. But it is possible to compare similar projects created with vue, react, angular, etc.
The initial notation was inspired by Mithril. However, my main focus is the "organization of complex projects". Using other frameworks everything was very mixed and tiring to deal with. When this did not uses ram of the computer, it consumed mental ram memory. :)
Removed duplicated code in MOD.mount https://github.com/Gurigraphics/DOMinus.js/issues/10
Hi, I dont understand the two following conditions in the code :
it seems to me that
data.mount
anddata.mountMap
are never set.Where am I wrong? Thank you.