Optional
converterOptional converter function to convert persisted state. This is useful when persisted state should be migrated to new version.
Rules of persistence conversion:
persistence-envelope.ts
)The converter function inside should compare version
attribute.
Mandatory function - provided externally - to read persisted state envelope
from the persistence target (local storage, etc.) under a given key
For the sake of simplicity, use synchronous get
from local-storage
Optional
getOptional function to generate a key in getEnvelope
and setEnvelope
functions.
Optional
prefix?: stringOptional
prefixState-container specific prefix name for a persistence entry in a key-value store. For now, the only key-value store supported is the local-storage.
Typically, the fraction of state will get persisted under the
App.Container.${containerId}
key. This prefix can be, however, changed
Mandatory function to write persisted state envelope to the persistence target
(local storage, etc.) under a given key
For the sake of simplicity, use synchronous set
from local-storage
npm library
Version of persisted state
Generated using TypeDoc
List of attributes to persist