How to use the ilib/lib/ResBundle function in ilib

To help you get started, we’ve selected a few ilib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github enactjs / enact / packages / moonstone / internal / $L / $L.js View on Github external
opts = {
			loadParams: {
				root: ILIB_MOONSTONE_PATH
			},
			...options
		};
	}

	if (!opts.onLoad) return;

	// Swap out app cache for moonstone's
	const appCache = ilib.data;
	ilib.data = global.moonstoneILibCache || cache;

	// eslint-disable-next-line no-new
	new ResBundle({
		...opts,
		onLoad: (bundle) => {
			ilib.data = appCache;
			opts.onLoad(bundle || null);
		}
	});
}
github enactjs / enact / packages / i18n / src / resBundle.js View on Github external
function createResBundle (options) {
	const opts = {
		type: 'html',
		name: 'strings',
		lengthen: true,		// if pseudo-localizing, this tells it to lengthen strings
		...options
	};

	if (!opts.onLoad) return;

	// eslint-disable-next-line no-new
	new ResBundle({
		...opts,
		onLoad: (bundle) => {
			opts.onLoad(bundle || null);
		}
	});
}