Merge branch 'master' of github.com:y-js/yjs
This commit is contained in:
commit
c7670915c7
15
src/Util/mutualExclude.js
Normal file
15
src/Util/mutualExclude.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
export function createMutualExclude () {
|
||||||
|
var token = true
|
||||||
|
return function mutualExclude (f) {
|
||||||
|
if (token) {
|
||||||
|
token = false
|
||||||
|
try {
|
||||||
|
f()
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
token = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user