Remove lodash deps to reduce bundle size more
This commit is contained in:
parent
0403fa9517
commit
cbea4078fb
8 changed files with 36 additions and 29 deletions
|
@ -2,7 +2,7 @@ import React, { useCallback, useEffect, useState } from 'react';
|
|||
import Chart, { ChartConfiguration } from 'chart.js';
|
||||
import { ServerContext } from '@/state/server';
|
||||
import { bytesToMegabytes } from '@/helpers';
|
||||
import merge from 'lodash-es/merge';
|
||||
import merge from 'deepmerge';
|
||||
import TitledGreyBox from '@/components/elements/TitledGreyBox';
|
||||
import { faMemory, faMicrochip } from '@fortawesome/free-solid-svg-icons';
|
||||
import tw from 'twin.macro';
|
||||
|
@ -59,7 +59,7 @@ const chartDefaults: ChartConfiguration = {
|
|||
};
|
||||
|
||||
const createDefaultChart = (ctx: CanvasRenderingContext2D, options?: ChartConfiguration): Chart => new Chart(ctx, {
|
||||
...merge({}, chartDefaults, options),
|
||||
...merge(chartDefaults, options || {}),
|
||||
data: {
|
||||
labels: Array(20).fill(''),
|
||||
datasets: [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue