Closed acstll closed 8 years ago
What about using a dummy thunk
helper server side? Something like this:
function thunk(name, fn) {
var i, args = [];
for (i = 2; i < arguments.length; ++i) {
args[i - 2] = arguments[i];
}
return fn.apply(null, args);
}
That pretty much makes thunk
a no-op.
I had this in mind, which should make it seamless:
https://github.com/acstll/snabbdom-to-html/blob/thunks/init.js#L26-L28
I also added a test https://github.com/acstll/snabbdom-to-html/blob/thunks/test/index.js#L217
What do you think? could there be any edge cases? I've never used thunks myself. :)
@paldepind I just realized I need to call apply
on those arguments! Will fix…
Added in 2.1.0
…should be simple.