mirror of
https://github.com/yjs/yjs.git
synced 2025-12-21 22:19:32 +01:00
16 lines
244 B
JavaScript
16 lines
244 B
JavaScript
|
|
|
||
|
|
export function createMutualExclude () {
|
||
|
|
var token = true
|
||
|
|
return function mutualExclude (f) {
|
||
|
|
if (token) {
|
||
|
|
token = false
|
||
|
|
try {
|
||
|
|
f()
|
||
|
|
} catch (e) {
|
||
|
|
console.error(e)
|
||
|
|
}
|
||
|
|
token = true
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|