mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-10 01:52:04 +05:30
23 lines
509 B
JavaScript
23 lines
509 B
JavaScript
|
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
|
||
|
}
|
||
|
})
|
||
|
);
|
||
|
}
|
||
|
};
|