Javascript – Access the returned value of an async function to use it in a Svelte component
I have the following piece of code (+layout.svelte): import { getLang } from "$lib/locale"; import { browser } from "$app/environment"; const loadLang = async () => { if (browser) { // return await getLang(document.documentElement.lang, "home").then( function (data: any) { //…