• get named object if it exists, otherwise add it

    Type Parameters

    • T extends Object3D<Event> = Object3D<Event>

    Parameters

    • parent: Object3D<Event>

      parent object

    • name: string

      object name to find

    • Optional create: (() => T)

      create the object when it does not exists

        • (): T
        • Returns T

    • Optional options: {
          afterCreate?: ((obj) => unknown);
          afterExists?: ((obj) => unknown);
      }

      options

      • Optional afterCreate?: ((obj) => unknown)
          • (obj): unknown
          • emitted when object does not exists

            Parameters

            • obj: T

            Returns unknown

      • Optional afterExists?: ((obj) => unknown)
          • (obj): unknown
          • emitted when object exists

            Parameters

            • obj: T

            Returns unknown

    Returns T

Generated using TypeDoc