Skip to content

Add singleton to interface

Compare
Choose a tag to compare
@omrilotan omrilotan released this 13 Sep 18:21
· 48 commits to master since this release

Singleton

Make sure you only have one instance of I18n in your global scope

const i18n = I18n.singleton;

i18n.$scope = 'my.scope'; // Optional
i18n.add({...});

Shortcut:

const i18n = require('@fiverr/i18n/singleton');