build<T> method

Step<T> build<T>(
  1. FutureOr<T> runStep(
    1. A valueA
    )
)

Build a step with a single dependency.

This methods requires a runStep function which runs the step, given values from evaluation of dependent steps. The runStep method may be asynchronous. The runStep method will be invoked by Runner.run when the step is evaluated.

The dependent Step which creates valueA passed to runStep have already be defined when this object was created. See Step.define for how to define steps using this API.

This method returns the Step built by the builder.

Implementation

Step<T> build<T>(FutureOr<T> Function(A valueA) runStep) =>
    Step._(_name, (r, wrap) async {
      final a_ = r.run(_a);
      await Future.wait([a_]);
      final a = await a_;
      return await wrap(() => runStep(a));
    }, [_a]);