initPersistence static method
Creates a directory on the disk to save stringified objects.
storeLocation
is optional for Web.
Persistence also enables cache behind the scenes.
Implementation
@Deprecated('Use configPersistence method')
static Future<void> initPersistence(String? storeLocation) async {
if (_persistent && _storeName != null) {
if (storeLocation != null) {
Hive.init(storeLocation);
}
await Hive.openBox(_storeName!);
// Config cache when persistence is in use
await MustangCache.initCache(_cacheStoreName!, storeLocation);
}
}