IO<T> constructor

IO<T>({
  1. required T seedValue,
  2. required String semantics,
  3. bool sync = true,
  4. bool isBehavior = true,
  5. bool acceptEmpty = true,
  6. bool isDistinct = false,
  7. bool isSame(
    1. T,
    2. T
    )?,
  8. bool printLog = true,
  9. FetchCallback<T, dynamic>? fetch,
  10. T onReset()?,
  11. 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}';
}