Skip to content

Commit

Permalink
feat: add garbage collection to pipe()
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 27, 2018
1 parent 46de4fd commit f2a9087
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions addon/pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ exports.addon = function (renderer) {
for (var prop in declarations)
rule.style.setProperty(prop, declarations[prop]);
}

// GC
for (var selectorTemplate2 in rules) {
if (!(selectorTemplate2 in css)) {
rules[selectorTemplate2].remove();
delete rules[selectorTemplate2];
}
}
},
remove: function () {
for (var selectorTemplate in rules)
Expand Down

0 comments on commit f2a9087

Please sign in to comment.