component / reactive

Tiny reactive template engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refactor rendering?

weepy opened this issue · comments

Reactive.prototype.set = function(name, val){
... 
    this.renderElement( el, obj[name](), name );
...
}

// By default we just set the textContent
// but perhaps we might want to do something else? 
Reactive.prototype.renderElement = function( el ,  value, name ) {
   el.textContent = value
}

yeah it's not even remotely done I wouldn't try and use it yet

m yeh - it would be good to be able to control the CSS too

i added some callback support for now, ill be changing it still though i dont like object literals for apis

My point, just in case you missed it, is for instance perhaps one wants to hide an element based on whether a property is true or not. Currently reactive doesn't do this, --- perhaps it's out of its scope. But its a very common usecase, so do you imagine that you would build this on top ?

yeah wouldn't be super easy right now, it doesn't do much at all right now but I'll be adding stuff.