• Simple function that registers any instance of a class as single and creates it when it is not existing. Instances are stored as globals which is the closest we can get to a real singleton. *

    Type Parameters

    • T extends (new (...args) => InstanceType<T>)

    Parameters

    • type: T
    • Rest ...args: ConstructorParameters<T>

    Returns InstanceType<T>