don't use lodash (-~300ms speed)
This commit is contained in:
parent
79d2184afa
commit
1cfdde819b
|
@ -7,8 +7,7 @@ export default {
|
||||||
'Icon',
|
'Icon',
|
||||||
'Button',
|
'Button',
|
||||||
'Input',
|
'Input',
|
||||||
'PanelHeader',
|
'PanelHeader'
|
||||||
'DropdownMenu'
|
|
||||||
],
|
],
|
||||||
defaultRules: [
|
defaultRules: [
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { convert, brightness } from 'chromatism'
|
import { convert, brightness } from 'chromatism'
|
||||||
import merge from 'lodash.merge'
|
|
||||||
import {
|
import {
|
||||||
alphaBlend,
|
alphaBlend,
|
||||||
getTextColor,
|
getTextColor,
|
||||||
|
@ -369,7 +368,7 @@ export const init = (extraRuleset, palette) => {
|
||||||
|
|
||||||
// Inheriting all of the applicable rules
|
// Inheriting all of the applicable rules
|
||||||
const existingRules = ruleset.filter(findRules({ component: component.name, ...combination, parent }))
|
const existingRules = ruleset.filter(findRules({ component: component.name, ...combination, parent }))
|
||||||
const { directives: computedDirectives } = existingRules.reduce((acc, rule) => merge(acc, rule), {})
|
const computedDirectives = existingRules.map(r => r.directives).reduce((acc, directives) => ({ ...acc, ...directives }), {})
|
||||||
const computedRule = {
|
const computedRule = {
|
||||||
component: component.name,
|
component: component.name,
|
||||||
...combination,
|
...combination,
|
||||||
|
|
Loading…
Reference in New Issue