refactor(easy-peasy): return single values from useStoreState

This commit is contained in:
moklick
2020-05-25 17:12:11 +02:00
parent 17614bda6b
commit 56cfc8d731
10 changed files with 93 additions and 130 deletions
@@ -25,11 +25,9 @@ const defaultColors = {
const Background = memo(
({ variant = BackgroundVariant.Dots, gap = 24, size = 0.5, color, style = {}, className = '' }: BackgroundProps) => {
const {
width,
height,
transform: [x, y, scale],
} = useStoreState((s) => s);
const width = useStoreState((s) => s.width);
const height = useStoreState((s) => s.height);
const [x, y, scale] = useStoreState((s) => s.transform);
const bgClasses = classnames('react-flow__background', className);
const bgColor = color ? color : defaultColors[variant];