Skip to content

Commit

Permalink
ensure LiteralWidgets with the same content don't get re-rendered
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Wymer committed Jun 15, 2016
1 parent 56fab95 commit aacb6ec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ Compiler.prototype.compile = function () {
js = `
function generateLiteralWidget(contents) {
function LiteralWidget(contents) {
this.name = 'LiteralWidget'
this.id = contents
this.contents = contents
}
LiteralWidget.prototype.type = 'Widget'
Expand All @@ -83,6 +85,9 @@ Compiler.prototype.compile = function () {
}
return root
}
LiteralWidget.prototype.update = function (previous, domNode) {
return domNode
}
// 'render' is called by the vdom-to-html module which is used in the unit tests
LiteralWidget.prototype.render = function () {
var h = require('virtual-dom/h')
Expand Down

0 comments on commit aacb6ec

Please sign in to comment.