S
Size: a a a
S
А
DS
IB
S
И
IB
const once = (fn) => {
return function () {
if (!fn) return;
fn();
fn = null;
};
};
И
M
const once = (fn) => {
return function () {
if (!fn) return;
fn();
fn = null;
};
};
RD
D
IB
M
IB
ГЩ
async function get_templates() {
let template_names = ['tokenfield', 'live_search', 'number'];
return template_names.reduce( async (accumulator, template_name) =>
{
accumulator[template_name] = await get_data(2000);
return accumulator;
}, {});
}
async function get_data(delay) {
return new Promise( resolve => setTimeout( () => resolve('test'), delay));
}
get_templates().then(console.log)
AP
async function get_templates() {
let template_names = ['tokenfield', 'live_search', 'number'];
return template_names.reduce( async (accumulator, template_name) =>
{
accumulator[template_name] = await get_data(2000);
return accumulator;
}, {});
}
async function get_data(delay) {
return new Promise( resolve => setTimeout( () => resolve('test'), delay));
}
get_templates().then(console.log)
DT
M
IB
M