attempting to resurrect full beans

This commit is contained in:
authentik Default Admin 2026-03-04 18:26:43 -08:00
parent bceee7ecf1
commit a961f387d6
9 changed files with 170 additions and 65 deletions

View file

@ -0,0 +1,23 @@
export class StoreController {
constructor(host, store, selector) {
this.host = host
this.store = store
this.selector = selector
host.addController(this)
}
hostConnected() {
this._unsub = this.store.subscribe(
(state) => {
const next = this.selector(state)
if (next !== this.value) {
this.value = next
this.host.requestUpdate()
}
}
)
this.value = this.selector(this.store.getState())
}
hostDisconnected() { this._unsub?.() }
}