forked from MapComplete/MapComplete
More css tweaks and bug fixes
This commit is contained in:
parent
fd350bb095
commit
eb4dda1ba2
29 changed files with 294 additions and 107303 deletions
|
@ -3,9 +3,11 @@ import {UIEventSource} from "../UI/UIEventSource";
|
|||
export class LocalStorageSource {
|
||||
|
||||
static Get(key: string, defaultValue: string = undefined): UIEventSource<string> {
|
||||
|
||||
const saved = localStorage.getItem(key);
|
||||
const source = new UIEventSource<string>(saved ?? defaultValue);
|
||||
|
||||
// ignore when running from the console
|
||||
source.addCallback((data) => {
|
||||
localStorage.setItem(key, data);
|
||||
console.log("Wriging ", key, data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue