implemented frontend including separate message system; started to implement backend

This commit is contained in:
User
2026-03-10 14:48:48 +01:00
committed by Jannik Luboeinski
parent 4275cbd795
commit 78d5352a48
1058 changed files with 101527 additions and 1 deletions

43
yjs-poll/node_modules/lib0/mutex.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
/**
* Mutual exclude for JavaScript.
*
* @module mutex
*/
/**
* @callback mutex
* @param {function():void} cb Only executed when this mutex is not in the current stack
* @param {function():void} [elseCb] Executed when this mutex is in the current stack
*/
/**
* Creates a mutual exclude function with the following property:
*
* ```js
* const mutex = createMutex()
* mutex(() => {
* // This function is immediately executed
* mutex(() => {
* // This function is not executed, as the mutex is already active.
* })
* })
* ```
*
* @return {mutex} A mutual exclude function
* @public
*/
export const createMutex = () => {
let token = true
return (f, g) => {
if (token) {
token = false
try {
f()
} finally {
token = true
}
} else if (g !== undefined) {
g()
}
}
}