blob: 10ab26b6cc39bc470db31cda80389f211c941363 (
plain)
1
2
3
4
5
6
7
8
9
10
|
export default function once(fn) {
function wrapper (...args) {
if (fn === null) return;
var callFn = fn;
fn = null;
callFn.apply(this, args);
}
Object.assign(wrapper, fn)
return wrapper
}
|