asyncSelect<B> method

AtomWithParent<Future<B>, Parent> asyncSelect<B>(
  1. B f(
    1. A value
    )
)

Create a derived atom, that transforms an atoms value using the given function f.

Only rebuilds when the selected value changes.

Implementation

AtomWithParent<Future<B>, Parent> asyncSelect<B>(
  B Function(A value) f,
) =>
    select(f).rawSelect((a) => a.whenOrElse(
          data: Future.value,
          orElse: () => Future.any([]),
        ));