callbackFactory

Instantiates data of type T using a delegate or function.

Encapsulates data's construction logic using a delegate. The algorithm uses a delegate to create required data, with a set of Args that are passed to delegate, and a locator for dependency fetching.

  1. auto callbackFactory(Locator!() locator, T delegate(Locator!(), Args) dg, Args args)
  2. auto callbackFactory(Locator!() locator, T function(Locator!(), Args) dg, Args args)
    callbackFactory
    (
    T
    Args...
    )
    (,
    T function
    (,
    Args
    )
    dg
    ,
    auto ref Args args
    )

Parameters

T

the constructed aggregate

Args

type tuple of arguments passed to delegate for aggregate's construction.

Meta