compare()

This function is part of Iconify Utils package.

Function compare() imported from customisations/compare is used for comparing 2 FullIconCustomisations objects.

This function is meant to be used by icon components to detect changes in icon customisations generated from component properties.

Usage

Function has the following parameters:

Function returns true if items match, false if not.

Example

example.ts
import { defaults } from '@iconify/utils/lib/customisations';
import { compare } from '@iconify/utils/lib/customisations/compare';

const item1 = {
   ...defaults,
   hFlip: true,
};
const item2 = {
   ...defaults,
};

if (compare(item1, item2)) {
   console.log('Identical');
} else {
   console.log('Different');
}