- /**
- * No editor open, Click a file to read about me
- */
No editor open, Click a file to read about me
No editor open, Click a file to read about me
// Code Snippet showcase
@josephenochCreated 5 months ago
details 3 stars
export default function* getLines(text,width){
const letters = text.split("")
let words =""
for(let i =0; i<(letters.length/59);i++){
for(let j =(width*(i)); j<(width*(i+1));j++){
if(letters[j]){
words+=letters[j]
if(j==(width*(i+1)-1)&& letters[j+1]!=" " && letters[j]!=" "){
words+="-"
}
}
}
yield words
words = ""
}
@josephenochCreated 5 months ago
details 3 stars
const WIDTH = 59
const lines = useMemo(()=>{
const genobj = getLines(text, WIDTH)
const res = []
let result = genobj.next()
while(!result.done){
res.push(result.value)
result = genobj.next()
}
return res
},[])
Design by Dare Lova
Built with ❤ by Joseph Enoch