import { writableStorageSubject } from './writable-storage-subject'; function createwritteableObjectSubject(fallback: string) { return writableStorageSubject( (x) => JSON.parse(x || fallback) as T, (x) => JSON.stringify(x) ); } export function writeableObjectSubject() { return createwritteableObjectSubject('{}'); } export function writeableArraySubject() { return createwritteableObjectSubject('[]'); }