@e280/authlocal
Version:
User-sovereign login system for everybody
21 lines (14 loc) • 383 B
text/typescript
import {debounce} from "@e280/stz"
import {signal} from "@benev/slate"
export type Flash = "none" | "good" | "bad"
export class Flasher {
#flashing = signal<Flash>("none")
reset = debounce(300, () => { this.#flashing.value = "none" })
get flashing() {
return this.#flashing.value
}
async flash(flash: Flash = "good") {
this.#flashing.value = flash
this.reset()
}
}