i am trying to save a map to my local storage and for some reason it never saves. i.e. it just saves as {}. The most annoying thing is that I'm sure this worked yesterday!
All help is much appreciated.
export async function getSportsList(){
let liveOddsApiKey = "blahdedah";
try{
let result = await axios (`${dataSourceURL}${sportDataURL}${liveOddsApiKey}`)
let sportList = new Map();
result.data.data.forEach(x=>{
sportList.set(x.title,x.key);
});
console.log("Data Loaded");
console.log(result);
console.log(sportList);
console.log(JSON.stringify(sportList));
localStorage.setItem('sportsData',JSON.stringify(sportList));
console.log(localStorage.getItem('sportsData'));
debugger;
} catch(error){alert(error);}
}
'''