Optional
options: PersistOptions<T> & { Configure using PersistOptions
Decorator function
class ThemeEngine {
@persist({default: 'os'}) current!: string;
}
const theme = new ThemeEngine();
console.log(theme.current) // Output: os
theme.current = 'light'; //Any changes will be automatically saved to localStorage
location.reload(); // Simulate refresh
console.log(theme.current) // Output: light
Sync class property with persistent storage (LocalStorage by default)