/* * SPDX-License-Identifier: GPL-3.0 * Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience * Copyright (c) 2023 Vendicated and Vencord contributors */ export function once(fn: T): T { let called = false; return function (this: any, ...args: any[]) { if (called) return; called = true; return fn.apply(this, args); } as any; }