hypery2k/nativescript-fabric

View on GitHub
src/fabric-common.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { CrashlyticsPlugin } from './fabric';

let INSTANCE: CrashlyticsPlugin;

export interface Android extends CrashlyticsPlugin { }

export interface IOS extends CrashlyticsPlugin { }

export function getInstance(T: new () => CrashlyticsPlugin): CrashlyticsPlugin {
  if (!INSTANCE) {
    INSTANCE = new T();
  }
  return INSTANCE;
}