Skip to content

Instantly share code, notes, and snippets.

@azasypkin
Last active June 26, 2018 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azasypkin/baf538847dfbf31c879ade5a1e9ef284 to your computer and use it in GitHub Desktop.
Save azasypkin/baf538847dfbf31c879ade5a1e9ef284 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
console.log('yay gist');
var IntlMessageFormat = require('intl-messageformat');
var memoizeFormatConstructor = require('intl-format-cache');
IntlMessageFormat.defaultLocale = 'ru';
console.log(`Default locale BEFORE memoize: ${IntlMessageFormat.defaultLocale}`);
var memoizedIntlMessageFormat = memoizeFormatConstructor(IntlMessageFormat);
var msg = memoizedIntlMessageFormat('message');
console.log(`Locale used in memoized instance: ${msg._resolveLocale()}`);
{
"name": "some-weird-gist-package",
"bin": "./index.js",
"version": "1.0.0",
"dependencies": {
"intl-format-cache": "^2.1.0",
"intl-messageformat": "^2.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment