itemFrHot method

Fr<V> itemFrHot(
  1. int index, {
  2. V? defaultValue,
  3. DspReg? disposers,
})

Implementation

Fr<V> itemFrHot(
  int index, {
  V? defaultValue,
  DspReg? disposers,
}) {
  return fr(
    () {
      final list = watch();
      if (index >= list.length) {
        return defaultValue ?? (throw 'defaultValue is null');
      }
      return list[index];
    },
    disposers: disposers,
  );
}