forked from MapComplete/MapComplete
Add icons, add validation, add phone and email types, add css fixes
This commit is contained in:
parent
eb4dda1ba2
commit
1372027dac
56 changed files with 2794 additions and 3474 deletions
|
@ -3,15 +3,19 @@ import {UIEventSource} from "../UI/UIEventSource";
|
|||
export class LocalStorageSource {
|
||||
|
||||
static Get(key: string, defaultValue: string = undefined): UIEventSource<string> {
|
||||
|
||||
|
||||
//*
|
||||
// ignore when running from the console
|
||||
return new UIEventSource<string>(defaultValue);
|
||||
/*/
|
||||
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)
|
||||
});
|
||||
return source;
|
||||
//*/
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue