IO<T> constructor
IO<T> ({
- required T seedValue,
- required String semantics,
- bool sync = true,
- bool isBehavior = true,
- bool acceptEmpty = true,
- bool isDistinct = false,
- bool isSame(
- T,
- T
- bool printLog = true,
- FetchCallback<
T, dynamic> ? fetch, - T onReset()?,
- PersistConfig<
T> ? persistConfig,
Implementation
IO({
required super.seedValue,
required String semantics,
super.sync,
super.isBehavior,
bool acceptEmpty = true,
bool isDistinct = false,
bool Function(T, T)? isSame,
super.printLog,
FetchCallback<T, dynamic>? fetch,
super.onReset,
super.persistConfig,
}) : super(
semantics: semantics,
) {
stream = _subject.stream;
_acceptEmpty = acceptEmpty;
_isDistinct = isDistinct;
if (isSame != null) _isSame = isSame;
_fetch = fetch ??
(_) =>
throw '[$semantics]在未设置fetch回调时调用了update方法, 请检查逻辑是否正确!\n${StackTrace.current}';
}