export default function once < F extends Function > ( fn ) { let called = false ; let result ; return function onceified ( this ) { if ( ! called ) { result = fn . apply ( this , arguments ) ; called = true ; } return result ; } as any ; }