Skip to content

Commit

Permalink
Remove global cache for easy refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
vovkasm committed Dec 16, 2016
1 parent 7969f80 commit 4476f95
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/stylesheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ class Stylesheet {
constructor () {
this.rules = {}
this.ngen = 0
this.cache = {}
}
addDefaultRules (rules) {
for (let selector in rules) {
Expand Down Expand Up @@ -191,14 +190,7 @@ class Stylesheet {
this.rules[key].sort(ruleComparator)
}
getProps (context, ownProps) {
let data
if (this.cache.hasOwnProperty(context)) {
data = this.cache[context]
} else {
data = this._resolve(context)
this.cache[context] = data
}

const data = this._resolve(context)
return mergeToProps(ownProps, data.props, data.style)
}
getRules (name) {
Expand Down Expand Up @@ -238,7 +230,6 @@ class Stylesheet {
}
_resetCache () {
this.ngen++
this.cache = {}
}
}

Expand Down

0 comments on commit 4476f95

Please sign in to comment.