accounts-frontend/src/services/font.js

23 lines
509 B
JavaScript
Raw Normal View History

2017-01-25 11:22:19 +05:30
import webFont from 'webfontloader';
export default {
/**
* @param {array} families
*
* @return {Promise}
*/
load(families = []) {
return new Promise((resolve) =>
webFont.load({
classes: false,
active: resolve,
inactive: resolve, // TODO: may be we should track such cases
timeout: 2000,
custom: {
families
}
})
);
}
};