implement a simple caching system for themes 3
This commit is contained in:
parent
15dde2d372
commit
5505a89e8a
8 changed files with 70 additions and 15 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { convert, brightness } from 'chromatism'
|
||||
import sum from 'hash-sum'
|
||||
import { flattenDeep } from 'lodash'
|
||||
import {
|
||||
alphaBlend,
|
||||
|
|
@ -142,8 +143,12 @@ componentsContext.keys().forEach(key => {
|
|||
components[component.name] = component
|
||||
})
|
||||
|
||||
const checksum = sum(components)
|
||||
|
||||
const ruleToSelector = genericRuleToSelector(components)
|
||||
|
||||
export const getChecksum = () => checksum
|
||||
|
||||
export const init = (extraRuleset, ultimateBackgroundColor) => {
|
||||
const staticVars = {}
|
||||
const stacked = {}
|
||||
|
|
@ -463,6 +468,7 @@ export const init = (extraRuleset, ultimateBackgroundColor) => {
|
|||
return {
|
||||
lazy: result.filter(x => typeof x === 'function'),
|
||||
eager: result.filter(x => typeof x !== 'function'),
|
||||
staticVars
|
||||
staticVars,
|
||||
checksum
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue