Skip to content

Commit

Permalink
removed useless dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
EagleMind committed Jan 22, 2024
1 parent 6ba3bfc commit 228a088
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/components/pallet.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect } from "react";
import { useSelector, useDispatch } from 'react-redux';
import React from "react";
import { useSelector } from 'react-redux';

import {
Gradient,
Expand All @@ -10,12 +10,8 @@ import AspectRatio from "./aspectRatio";
import { RootState } from "../redux/store";

export const ColorsView: React.FC = () => {
const dispatch = useDispatch();
const colors: string[] = useSelector((state: RootState) => state.colorsGenerated.colors);

useEffect(() => {
}, [dispatch]);

function isArrayOfObjects(colors: any): colors is { from: string; to: string }[] {
return Array.isArray(colors) && colors.length > 0 && typeof colors[0] === 'object' && 'from' in colors[0] && 'to' in colors[0];
}
Expand Down

0 comments on commit 228a088

Please sign in to comment.