Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
576 B · 20 lines
TypeScript
123456789101112131415161718192021// emoji cache fileimport { EmojiData } from "@streamplace/components/src/components/chat/emoji-suggestions";
import { useEffect, useState } from "react";
let emojiPromise: Promise< typeof import("../assets/emoji-data-stripped.json")> | null = null;export function useEmojiData(): EmojiData | null { const [emoji, setEmoji] = useState<EmojiData | null>(null); if (!emojiPromise) { emojiPromise = import("../assets/emoji-data-stripped.json"); } useEffect(() => { emojiPromise!.then((emoji) => { setEmoji(emoji); }); }, []); return emoji;}