Hi All,
I have been fruitlessly trying to use singult.Unify with a coffeescript application.
The following code
itemFn = (item) -> ["div", item]
singult.Unify([1,2,3,4], itemFn)
returns undefined.
Stepping into the code shows that singult.Unify just performs a few assignments into this
which is window.singult and it returns the result of the last assignment which is "return this.g = f".
f is the exit function which is optional along with the enter update and key_fn.
This is the minified version of the singult.Unify function
function y(a, b, c, e, d, f) {
this.data = a;
this.b = b;
this.d = c;
this.a = e;
this.update = d;
return this.g = f
}
I see that the Unify function in the coffee source takes an extra parameter (force_update_p) and ends with
"return this" and not "return this.g = f"
Calling
itemFn = (item) -> ["div", item]
singult.render(["div", singult.Unify([1,2,3,4], itemFn)])
throws cannot read property 0 of undefined while calling the following function
explode_p = function(v) {
return v[0] === ":*:";
};
Any insights would be greatly appreciated cause I am pretty much stuck.
Also I havent researched this alot but is it possible to escape-html while creating content nodes ?
Thanks,
Dimitris