forked from MapComplete/MapComplete
Huge refactoring: split readonly and writable stores
This commit is contained in:
parent
0946d8ac9c
commit
4283b76f36
95 changed files with 819 additions and 625 deletions
|
@ -6,7 +6,7 @@ import {UIEventSource} from "../UIEventSource";
|
|||
export class LocalStorageSource {
|
||||
|
||||
static GetParsed<T>(key: string, defaultValue: T): UIEventSource<T> {
|
||||
return LocalStorageSource.Get(key).map(
|
||||
return LocalStorageSource.Get(key).sync(
|
||||
str => {
|
||||
if (str === undefined) {
|
||||
return defaultValue
|
||||
|
|
|
@ -33,7 +33,7 @@ export class QueryParameters {
|
|||
}
|
||||
|
||||
public static GetBooleanQueryParameter(key: string, deflt: boolean, documentation?: string): UIEventSource<boolean> {
|
||||
return QueryParameters.GetQueryParameter(key, ""+ deflt, documentation).map(str => str === "true", [], b => "" + b)
|
||||
return QueryParameters.GetQueryParameter(key, ""+ deflt, documentation).sync(str => str === "true", [], b => "" + b)
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {UIEventSource} from "../UIEventSource";
|
||||
import {Store} from "../UIEventSource";
|
||||
|
||||
export interface Review {
|
||||
comment?: string,
|
||||
|
@ -9,5 +9,5 @@ export interface Review {
|
|||
/**
|
||||
* True if the current logged in user is the creator of this comment
|
||||
*/
|
||||
made_by_user: UIEventSource<boolean>
|
||||
made_by_user: Store<boolean>
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue