I am implementing watch geolocation feature in my React Native app with help of @react-native-community/geolocation and I create an initialize saga function which is responsible for starting the geolocation.watchPosition. I want to pass an redux saga callback function which will update my redux state but it doesn't trigger that callback onGeolocationGet function:
function* initialize(): SagaReturnType<any> {
try {
yield effects.call(geolocation.watchPosition, function* onGeolocationGet(data) {
yield effects.put(UserActions.updateCurrentLocation({ ...data.coords }))
})
} catch (err) {
console.error(err)
}
}
Thank you mates in advance!