getData<T>(key: string, def?: T): T | null

Get data from local storage, if not present can set to a default value.