react-native-ui-lib
Version:
UI Toolset & Components Library for React Native
26 lines (19 loc) • 514 B
JavaScript
import _ from 'lodash';
const icons = require('./icons');
const emojis = require('./emojis');
class Assets {
icons = icons;
emojis = emojis;
loadAssetsGroup(groupName, assets) {
if (!_.isString(groupName)) {
throw new Error('group name should be a string');
}
if (!_.isPlainObject(assets)) {
throw new Error('assets should be a hash map');
}
_.forEach(assets, (value, key) => {
_.set(this, `${groupName}.${key}`, value);
});
}
}
export default new Assets();