herb-foliage
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -89,8 +89,10 @@ (function(){ | ||
return { | ||
attach:function (elements, index) { | ||
elementsToUpdate = elements; | ||
indexToUpdate = index; | ||
elements[index] = factory(initial)(result); | ||
element: { | ||
attach:function (elements, index) { | ||
elementsToUpdate = elements; | ||
indexToUpdate = index; | ||
elements[index] = factory(initial)(result); | ||
} | ||
}, | ||
__next: function(next) { | ||
next: function(next) { | ||
elementsToUpdate[indexToUpdate] = factory(next)(result); | ||
@@ -97,0 +99,0 @@ } |
@@ -15,17 +15,20 @@ (function(){ | ||
dynamic:function(elementFactory, initial) { | ||
var component; | ||
var result = react.createElement(react.createClass({ | ||
getInitialState : function (){ | ||
return initial;}, | ||
render: function(){ | ||
component = this; | ||
return elementFactory(this.state)(factory); | ||
} | ||
})); | ||
result.__proto__.__next = function(state){ | ||
if(component){ | ||
component.setState(state); | ||
} | ||
}; | ||
return result; | ||
return (function(){ | ||
var component; | ||
var result = {} | ||
result.element = react.createElement(react.createClass({ | ||
getInitialState : function (){ | ||
return initial;}, | ||
render: function(){ | ||
component = this; | ||
return elementFactory(this.state)(factory); | ||
} | ||
})); | ||
result.next = function(state){ | ||
if(component){ | ||
component.setState(state); | ||
} | ||
}; | ||
return result | ||
})(); | ||
} | ||
@@ -32,0 +35,0 @@ }; |
{ | ||
"name": "herb-foliage", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "A DSL to write HTML to a DOM", | ||
@@ -5,0 +5,0 @@ "main":"foliage.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54095
617