L
Size: a a a
L
КГ
this.createdTableArr = [...new
ArrayArray(this.eatingCounter.value)].map((item, index) => ({
id: index,
eating: 'Завтрак',
time: '07:00',
dailyCalories: 20,
}));
L
function* sleep(ms, val) {
return yield new Promise(r => setTimeout(() => r(val), ms))
}
function* test(fl) {
if ( fl ) {
const val = yield* sleep(1000, 'reg')
console.log({ val })
}
return 0
}
function* test2() {
Promise.resolve().then(() => console.log('after'))
console.time('test')
for(let i = 0; i < 1e6; i++) {
yield* test()
}
console.timeEnd('test')
Promise.resolve().then(() => console.log('before sleep'))
const result = yield* test(1)
console.log( {result} )
}
asyncWrapper(test2)
A
this.createdTableArr = [...new
ArrayArray(this.eatingCounter.value)].map((item, index) => ({
id: index,
eating: 'Завтрак',
time: '07:00',
dailyCalories: 20,
}));
КГ
A
В
AT
AT
AT
AT
L
L
function* sleep(ms, val) {
return yield new Promise(r => setTimeout(() => r(val), ms))
}
function* test(fl) {
return fl ? yield* sleep(1000, 'reg') : 2
}
function* test2() {
Promise.resolve().then(() => console.log('after'))
let sum = 0
for(let i = 0; i < 1e6; i++)
sum += yield* test()
console.log({ sum })
Promise.resolve().then(() => console.log('before sleep'))
const result = yield* test(1)
console.log( {result} )
}
asyncWrapper(test2)
L
В
L
A
this.createdTableArr = [...new
ArrayArray(this.eatingCounter.value)].map((item, index) => ({
id: index,
eating: 'Завтрак',
time: '07:00',
dailyCalories: 20,
}));
createdTableArr
. Побольше бы конкретики.С
У