@ngx-pwa/local-storage
Advanced tools
Changelog
6.2.4 & 8.0.1 (2019-06-05)
indexedDB
or localStorage
variables causes a security exception,
and all Angular code will fail. So the library is now catching the error,
and fallbacks to in-memory storage in this case.Changelog
8.0.0 (2019-05-29)
A full migration guide to version 8 is available.
v8 requires Angular 8.
StorageMap
serviceSee the general documentation.
getItem()
getItem()
is now inferred for basic types (string
, number
, boolean
) and arrays of basic types (string[]
, number[]
, boolean[]
)JSONSchema
interface, IntelliSense will adjust itself based on the type
optionSee the new validation guide.
This library started as a little project and is now the first Angular library used for client-side storage. It was time to do a full review and refactoring, which results in:
indexedDB
database and object store names default values are exported and can be changed
(see the interoperability guide)null
or undefined
, removeItem()
instead of just bypassing (meaning the old value was kept)type
now required for array, object, const and enum validation schemasJSONSchemaNull
removed (useless, null
does not require any validation)JSONSchema
no longer accepts extra propertiesgetUnsafeItem()
is removed (was already deprecated in v7).has()
, .keys()
and .size
are deprecated in LocalStorage
. They will be removed in v9. They moved to the new StorageMap
service.JSONSchemaNumeric
deprecated (will be removed in v9)LSGetItemsOptions
deprecated (not necessary anymore, will be removed in v9)LOCAL_STORAGE_PREFIX
, LocalStorageProvidersConfig
and localStorageProviders()
deprecated (will be removed in v9). Moved to StorageModule.forRoot()
setItemSubscribe()
, removeItemSubscribe()
and clearSubscribe()
deprecated (will be removed in v9)Should not concern you as it was internal stuff.
IndexedDBDatabase
and LocalStorageDatabase
not exported anymoreMockLocalDatabase
renamed and not exported anymore