Spaces:
Sleeping

File size: 202 Bytes
5a6a0a1
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
function streamText(text, setOutput) {
  let i = 0;
  const interval = setInterval(() => {
    setOutput(prev => prev + text[i]);
    i++;
    if (i >= text.length) clearInterval(interval);
  }, 15);
}