[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => https://github.com/ngxs/store/blob/master/CONTRIBUTING.md
[ ] Other... Please describe:
@State({
name: 'filter',
defaults: new Filter()
})
export class FilterState {
// ..
}
not intuitive
NgxsStoragePluginModule.forRoot({ key: [..., 'filter'] })
import { PersistenceState } from '@ngxs/storage-plugin';
@State({
name: 'filter',
defaults: new Filter()
})
@PersistenceState()
export class FilterState {
// ..
}
NgxsStoragePluginModule.forRoot()
@PersistenceState({ name: 'key' })
@PersistenceState({ name: 'key', alias: 'keyAlias' })
@PersistenceState({ name: 'key', expiredTime: 100000 // ms })
@PersistenceState({ name: 'key', storage: 'localStorage' })
@PersistenceState({ name: 'key', storage: 'sessionStorage' })
@PersistenceState({ name: 'key', storage: 'indexDB' })
@splincode
I have a slightly related question, why not use localForage for the plugin?
It will enable IndexedDB by default and handle fallback when needed.
@YogliB hello, the problem is that we want to use several kinds of storages
I use ngxs data plugin for now
Most helpful comment
https://www.npmjs.com/package/@ngxs-labs/data