UNPKG

@benev/slate

Version:
17 lines (12 loc) 196 B
export class Locker { #locked = false lock<R>(fn: () => R) { this.#locked = true const result = fn() this.#locked = false return result } get locked() { return this.#locked } }