Skip to content

Commit

Permalink
chore(icon): remove preload deprecated notice (#768)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nantawat-Poothong authored Jun 22, 2023
1 parent 263f016 commit e7aad23
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions packages/elements/src/icon/utils/IconLoader.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { SVGLoader } from '@refinitiv-ui/utils/loader.js';
import { DeprecationNotice } from '@refinitiv-ui/core';

/**
* Caches and provides icon SVGs, Loaded either by name from CDN or directly by URL.
Expand All @@ -12,21 +11,12 @@ const iconLoaderInstance = new IconLoader();
export { iconLoaderInstance as IconLoader };

/**
* Deprecation notice displays a warning message
* when deprecated features are used.
*/
const deprecationNotice = new DeprecationNotice('Icon `preload()` is deprecated.');


/**
* @deprecated Icon `preload()` is deprecated.
* Helper function to preload set of icons.
* It could help to reduce icon loading delay when ef-icon has a known set of icons that it can use.
* @param attrs - list of arguments, representing icons.
* Could be icon names, complete icon URLs or mix of both.
* @returns Array of promises, which will be resolved with SVG bodies.
*/
export const preload = (...attrs: string[]): Promise<string | undefined>[] => {
deprecationNotice.once();
return attrs.map(icon => iconLoaderInstance.loadSVG(icon));
};

0 comments on commit e7aad23

Please sign in to comment.