Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Make Platform.flush really a no-op in the presence of Object.observe.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Mar 22, 2014
1 parent 59f745d commit 93ec905
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/patches-mdv.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ function flush() {
};

// polling dirty checker
var FLUSH_POLL_INTERVAL = 125;
window.addEventListener('WebComponentsReady', function() {
flush();
// flush periodically if platform does not have object observe.
if (!Observer.hasObjectObserve) {
// flush periodically if platform does not have object observe.
if (!Observer.hasObjectObserve) {
var FLUSH_POLL_INTERVAL = 125;
window.addEventListener('WebComponentsReady', function() {
flush();
scope.flushPoll = setInterval(flush, FLUSH_POLL_INTERVAL);
}
});
});
} else {
// make flush a no-op when we have Object.observe
flush = function() {};
}

if (window.CustomElements && !CustomElements.useNative) {
var originalImportNode = Document.prototype.importNode;
Expand Down

0 comments on commit 93ec905

Please sign in to comment.