Check out example codes for "typescript singleton". It will help you in understanding the concepts better.

Code Example 1

class MyClass
{
    private static _instance: MyClass;

    private constructor()
    {
        //...
    }

    public static get Instance()
    {
        // Do you need arguments? Make it a regular static method instead.
        return this._instance || (this._instance = new this());
    }
}

const myClassInstance = MyClass.Instance;

Learn ReactJs, React Native from akashmittal.com