Function LazyKey

  • Resolves the dependencies specified by the return value of src. Useful when depending on a class or TypeKey that hasn't yet been declared.

    Type Parameters

    Parameters

    • src: (() => K)
        • (): K
        • Returns K

    Returns LazyKey<K>

    Example

    In this example, LazyKey(() => NameKey) is necessary because MyFactory is declared before NameKey:

    class MyFactory extends FactoryKey(
    LazyKey(() => NameKey), (name, id: string) => name + id,
    ) { private _: any }

    class NameKey extends TypeKey<string>() { private _: any }

Generated using TypeDoc