translate-maker
Version:
Lightweight translation module. Internationalize your great project.
17 lines (12 loc) • 336 B
JavaScript
import Translate from './Translate';
let instance = null;
export default function getInstance(options) {
if (instance) {
return instance;
}
if (!options) {
throw new Error('You need to initialize singleton instance first. Call getInstance with options.');
}
instance = new Translate(options);
return instance;
}