PersistentValueBlop<T> constructor
PersistentValueBlop<T> (
- FutureOr<
T> _defaultValue(), { - PersistentBlopStore<
T> ? store, - String? valueName,
- bool reloadOnCreate = true,
Implementation
PersistentValueBlop(
this._defaultValue, {
PersistentBlopStore<T>? store,
String? valueName,
bool reloadOnCreate = true,
}) : _store = store ?? HiveBlopStore<T>(),
super(
_lrc = Cubits.fromValue<FutureOr<T> Function()>(
() => null as dynamic,
),
reloadOnCreate: false,
reloadOnLoaderChange: false,
) {
_valueName = valueName ?? runtimeType.toString();
// HACK all this shitty code only for pass store.load to super constructor, hate this shit
_reloadCubit = _lrc;
_lrc = null;
_reloadCubit.emit(_store.load);
if (reloadOnCreate) reload();
}