Update Fix
This commit is contained in:
14
node_modules/alpinejs/src/utils/once.js
generated
vendored
Normal file
14
node_modules/alpinejs/src/utils/once.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
export function once(callback, fallback = () => {}) {
|
||||
let called = false
|
||||
|
||||
return function () {
|
||||
if (! called) {
|
||||
called = true
|
||||
|
||||
callback.apply(this, arguments)
|
||||
} else {
|
||||
fallback.apply(this, arguments)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user