sessionStorageor any other mechanism you wish.
NgxsStoragePluginModuleinto your app module like:
key: State name(s) to be persisted. You can pass a string or array of strings that can be deeply nested via dot notation. If not provided, it defaults to all states using the
storage: Storage strategy to use. This defaults to LocalStorage but you can pass SessionStorage or anything that implements the StorageEngine API.
deserialize: Custom deserializer. Defaults to
serialize: Custom serializer. Defaults to
migrations: Migration strategies
beforeSerialize: Interceptor executed before serialization
afterDeserialize: Interceptor executed after deserialization
keyoption is used to determine what states should be persisted in the storage.
keyshouldn't be a random string, it has to coincide with your state names. Let's look at the below example:
keyoption, so it's enough just to write:
NovelsState? Then we would have needed to pass its name to the
version: The version we are migrating
versionKey: The identifier for the version key (Defaults to 'version')
migrate: A function that accepts a state and expects the new state in return.
key: The key for the item to migrate. If not specified, it takes the entire storage state.