From 215b0c5cb2ff0ef0b2c7b5549704e23d651a4df9 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Thu, 10 Oct 2024 21:51:10 -0400 Subject: Hoist the UI one step up further --- ui/lib/store/logins.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ui/lib/store/logins.js (limited to 'ui/lib/store/logins.js') diff --git a/ui/lib/store/logins.js b/ui/lib/store/logins.js new file mode 100644 index 0000000..5b45206 --- /dev/null +++ b/ui/lib/store/logins.js @@ -0,0 +1,22 @@ +export class Logins { + constructor() { + this.logins = {}; + } + + addLogin(id, name) { + this.logins[id] = name; + return this; + } + + setLogins(logins) { + this.logins = {}; + for (let { id, name } of logins) { + this.addLogin(id, name); + } + return this; + } + + get(id) { + return this.logins[id]; + } +} -- cgit v1.2.3