010101 CommentPost.prototype.config
is now CommentPost.prototype.oncreate
and CommentPost.prototype.onupdate
. There's no longer an isInitalized
parameter, instead oncreate
is called once, and onupdate
is called for subsequent redraws.
Basically
extend(CommentPost.prototype, 'config', function (out, isInitialized, vnode) {
// [the code]
});
becomes
extend(CommentPost.prototype, 'oncreate', function (out, vnode) {
// [the code]
});
extend(CommentPost.prototype, 'onupdate', function (out, vnode) {
// [the code]
});
A function can be used to not repeat the code.
Or, when isInitialized
is used:
extend(CommentPost.prototype, 'config', function (out, isInitialized, vnode) {
if (isInitialized) return;
// [the code]
});
becomes
extend(CommentPost.prototype, 'oncreate', function (out, vnode) {
// [the code]
});
EDIT: ignore my previous edit referencing super
, it only applies if you were creating your own components.