I got the callback to work! I never really implemented my own callback before so I had to read the documentation. I’m still not 100 percent sure why it works, but adding another parameter to the function worked:
let value;
function showBar(val, callback) {
AsyncStorage("key", (err, result) => {
result ? val = true : val = false;
callback(val);
}
}
showBar(value, (bool) => {return bool});
Both pieces of code have a missing closing parenthesis for the AsyncStorage call:
...
callback(val)
})
...
Other than that I don’t see a syntax or reference problem with showBar((bool)=>{}) - in fact with a single parameter you don’t even need the parentheses showBar(bool=>{})