mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) New UI for raw data views
Summary: Creating new UI for raw data views based on design. - Renaming left for follow up diff - Link in the menu is hidden for now To access raw UI, use /p/data URL. Test Plan: new tests Reviewers: georgegevoian Reviewed By: georgegevoian Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D3306
This commit is contained in:
@@ -63,9 +63,9 @@ export function localStorageBoolObs(key: string, defValue = false): Observable<b
|
||||
/**
|
||||
* Helper to create a string observable whose state is stored in localStorage.
|
||||
*/
|
||||
export function localStorageObs(key: string): Observable<string|null> {
|
||||
export function localStorageObs(key: string, defaultValue?: string): Observable<string|null> {
|
||||
const store = getStorage();
|
||||
const obs = Observable.create<string|null>(null, store.getItem(key));
|
||||
const obs = Observable.create<string|null>(null, store.getItem(key) ?? defaultValue ?? null);
|
||||
obs.addListener((val) => (val === null) ? store.removeItem(key) : store.setItem(key, val));
|
||||
return obs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user