add some jsdoc
This commit is contained in:
@@ -4,6 +4,11 @@
|
||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||
*/
|
||||
|
||||
/**
|
||||
* Wraps the given function so that it can only be called once
|
||||
* @param fn Function to wrap
|
||||
* @returns New function that can only be called once
|
||||
*/
|
||||
export function once<T extends Function>(fn: T): T {
|
||||
let called = false;
|
||||
return function (this: any, ...args: any[]) {
|
||||
|
||||
Reference in New Issue
Block a user