Function singleton

  • Returns ((Class) => any)

      • (Class): any
      • Parameters

        • Class: any

        Returns any

    Description

    Decorator that realize singletone pattern

    Example

    import { singleton } from '@biorate/collection';

    @singleton()
    class Test {}

    const a = new Test();
    const b = new Test();

    console.log(a === b); // true

Generated using TypeDoc