Currently each of the value is set after setting the previous value, the async calls are not executed in parrallel. How do I make these calls execute in parallel?
const [index, setIndex] = useState(0);
const [roll, setRollNo] = useState(1);
const [sem, setSemester] = useState(1);
useEffect(() => {
getMyValue();
}, []);
const getMyValue = async () => {
try {
setIndex(JSON.parse(await AsyncStorage.getItem('@branch')) || 0);
setSemester(JSON.parse(await AsyncStorage.getItem('@sem')) || 1);
setRollNo(JSON.parse(await AsyncStorage.getItem('@roll')) || 1);
} catch (e) {
// console.log(e);
}
};