victorkvarghese / react-native-boilerplate

🚀 Type Based Architecture for developing React Native Apps using react, redux, sagas and hooks with auth flow
MIT License
605 stars 207 forks source link

Add Example for call API and change state. #18

Closed pqv2210 closed 4 years ago

pqv2210 commented 4 years ago

Hi, I'm new to redux-saga and I don't know how to change the state and call the API use Redux and Redux-saga. Can you add some example in your project? Thank you! 😄

victorkvarghese commented 4 years ago

@pqv2210 You can see the commented code in loginSaga.

loginSaga gets invoked when you dispatch LOGIN_REQUEST. Saga contains how to call api (loginUser will be an async fetch)