nepalcodes / nepalingo

A website to learn the indigenous language of Nepal.
0 stars 0 forks source link

Create a function that makes an API request to nepalbhasa's backend when given a word. And hardcode a list of words into our frontend app #42

Open binamkayastha opened 6 days ago

christikaes commented 16 hours ago

Write this as a hook: https://tanstack.com/query/latest/docs/framework/react/reference/useQuery

christikaes commented 15 hours ago

Rough notes

type LanguageDictionary { language: "newari" | "tajpuriya" words: [string, string ] // english, translated }

useNewari(numberOfWords): LanguageDictionary { // Gets data from NepalBhasa {data} = useQuery("nepalBhasa.com", {...})

return { language: "newari", words: //reformat data }

}

useTajpuriya (number of words): LanguageDictionary { {data} = //load from CSV

return { language: "newari", words: //reformat data }

}