Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Lookup<Factory, Instance>

Type parameters

  • Factory

  • Instance

Hierarchy

  • Lookup

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Lookup(lookupFactory?: undefined | (() => Factory | undefined)): Lookup

Properties

Protected Readonly factories

factories: WeakMap<any, {}> = new WeakMap<any, Record<string, Factory | null>>()

Protected Readonly instances

instances: WeakMap<any, {}> = new WeakMap<any, Record<string, Instance | null>>()

Methods

getFactory

  • getFactory(thisArg: any, name: string, prefer?: Factory): Factory | undefined

getInstance

  • getInstance(thisArg: any, name: string, create: () => Instance | undefined): Instance | undefined
  • Parameters

    • thisArg: any
    • name: string
    • create: () => Instance | undefined
        • (): Instance | undefined
        • Returns Instance | undefined

    Returns Instance | undefined

Generated using TypeDoc