export function once(fn: (...args: T) => any) { let called = false return (...args: T) => { if (!called) { called = true return fn(...args) } } }