const freqUpdateInMs = 1000
export default {
data() {
return {
loading: false,
items: {},
timer: null
}
},
mounted() {
const fetchData = () => {
this.$store.commit('setLoading', true)
this.fetchData()
.finally(() => {
this.timer = setTimeout(fetchData, freqUpdateInMs)
this.$store.commit('setLoading', false)
})
}
fetchData()
},
beforeDestroy() {
clearTimeout(this.timer)
}
}
interface TableProps<T extends Record<string, unknown>> {
entities: T[] | null; // тут возможно еще стоит сделать это поле необязательным?
}
const Table = function <T extends Record<string, unknown>>({
entities,
}: TableProps<T>) {
// ...
return (<>
{entities?.map((entity, key) => {
return Object.entries(entity).map(([key, value], index) => {
// ...
});
})}
</>);
}
print(f'Осталось {a} секунд', end='\r')
import time
a = input('Укажите время для таймера в секундах - ')
space = ' ' * len(a)
a = int(a)
while a > 0 :
print(f'Осталось {a} секунд', space, end='\r')
a -= 1
time.sleep(1)
print('Таймер завершен ')
box.addEventListener('mousemove', move, { once: true });
https://developer.mozilla.org/en-US/docs/Web/API/E... eval("/name=" + lastResFind + "/gi")
https://developer.mozilla.org/en-US/docs/Web/JavaS... type ExtractGenerics<T extends readonly unknown[]> = T extends readonly []
? []
: T extends readonly [G<infer V>, ...infer Next]
? [V, ...ExtractGenerics<Next>]
: never;
function unwrap<C extends readonly G<unknown>[]>(containers: C) {
return containers.map(container => container.value) as ExtractGenerics<C>
}
const channelId = channel.id;
const guildId = channel.guild?.id;
const adapterCreator = channel.guild?.voiceAdapterCreator;
if (!channelId || !guildId || !adapterCreator) {
message.channel.send(`Please log into the voice channel`);
return;
}
if (command === 'join') {
const connection = joinVoiceChannel({
channelId,
guildId,
adapterCreator
});
message.channel.send(`Already here !`);
}
if (error.value && 'data' in error.value) {
// ...
}