I am implementing fingerprint scanning in my RN app and I found a good tutorial for that but the code there has a syntax which I have never used - yield call(), however, I googled it and couldn't find a proper explanation for it.
Here is the code:
if (isFingerPrintSupported === true) {
yield call(KeychainService.setCredentials, user_name,
JSON.stringify({ password }));
}
Is there something else I can use instead in this case? if not then how can I import this or install in order to make it work?
EDIT(example code added):
componentWillMount() {
let credentials = yield call(KeychainService.getCredentials);
if (credentials && credentials.username)) {
let isFingerPrintSupported = yield call(KeychainService.checkBiometricSupportednEnrolled);
if (isFingerPrintSupported === true) {
// show fingerprint alert on login page
// and authenticate FingerPrint when user touch the sensor
}
} else {
// else don’t show fingerprint option on login
}
}