mirror of
https://github.com/Tribufu/TribufuJS
synced 2026-08-07 20:06:21 +00:00
23 lines
563 B
TypeScript
23 lines
563 B
TypeScript
// Copyright (c) Tribufu. All Rights Reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
import { TribufuApi } from "./index";
|
|
|
|
/**
|
|
* **Tribufu API**
|
|
*
|
|
* Helper class to get a singleton instance of the Tribufu API.
|
|
*/
|
|
export class TribufuApiSingleton {
|
|
private static INSTANCE: TribufuApi | null = null;
|
|
|
|
private constructor() {}
|
|
|
|
public static getInstance(): TribufuApi {
|
|
if (!TribufuApiSingleton.INSTANCE) {
|
|
TribufuApiSingleton.INSTANCE = TribufuApi.fromEnvOrDefault();
|
|
}
|
|
|
|
return TribufuApiSingleton.INSTANCE;
|
|
}
|
|
}
|