init method

dynamic init()

Cache Store init function.

Must be executed and, awaited before accessing data from store.

Implementation

init() async {
  if (!Hive.isAdapterRegistered(0)) {
    Hive.registerAdapter(ItemCacheAdapter());
  }

  _box = await Hive.openBox<ItemCache>("__cache__.$name");

  clearExpired();
}