Skip to content

Release v20.42.0

Choose a tag to compare

@github-actions github-actions released this 16 Jun 08:01
bb96580

Summary

Commands can now declare a Provide() method that runs before Handle(). It fetches or computes the data the decision needs and passes it into Handle() as arguments, so Handle() stays a pure, easily tested function of its inputs. It can also short-circuit the command before Handle() runs.

Added

  • Commands can define a Provide() method that supplies Handle()'s arguments — fetched or computed, with its own parameters resolved from dependency injection — without registering those values in the container. Single, tuple, Result<,>, and async (Task/ValueTask) return shapes are all supported.
  • New analyzer rule ARC0005 warns when a value produced by Provide() is not consumed by any Handle() parameter.