IResponsibilityNode<R, A> typedef

IResponsibilityNode<R, A> = FutureOr<ChainResult<R>> Function(A args)

A typedef representing a handler (responsibility node) that takes args of type A and returns a Future<ChainResult> or ChainResult itself with the type parameter of R. Calling this method should either return a FutureOr<ChainResult<R>>, or throw an exception. Throwing an exception will have the same effect as returning a ChainResult.failure.

Alternatively, if you need to use objects as nodes, implement IResponsibilityNodeBase and treat its objects as regular IResponsibilityNodes.

See also: ChainResult, IResponsibilityNodeBase.

Implementation

typedef IResponsibilityNode<R, A> = FutureOr<ChainResult<R>> Function(A args);