Jump into React- Native 5/6 Waqqas Jabbar 4th July 2018
What you learned previously 1. Redux-Form 2. Styling
1. REST API a. Postman 2. Redux-Saga What you will learn today
What you will do today ● Add boilerplate to run Redux-Saga ○ yarn add apisauce jsuri lodash moment moment-timezone redux-saga yarn ○ Add boilerplate code ● Add TasksSaga ● Add REST API ● Handling network connection ● Generator Functions
TODO App - REST Device API https://documenter.getpostman.com/view/2287673/RWM6wrX5
Redux Middleware Put code between dispatching an action and reaching a reducer
Redux without Middleware
Redux with Middleware
Redux Saga: Advantages ● Write Async code a synchronous ● More readable ○ I.e. Write business logic in a single location ● Easy Testing ● Written as generator functions
Generator Functions ● Generator functions are functions that can start, paused, and resumed. It maintains its state ● yield defines one iteration
Redux-Saga: Helper functions ● take(takeLatest, takeEvery): handle an action ● call: call a function that return promise ● put: generate a new action ● select: get data from redux ● fork: fork a new “thread” ● channel
Reading REST API ● https://restful.io/an-introduction-to-api-s-cee90581ca1b ● https://www.tutorialspoint.com/restful/restful_introduction.htm ● https://knpuniversity.com/screencast/rest/intro Redux-Saga ● https://redux-saga.js.org/docs/basics/UsingSagaHelpers.html
Reference ● https://redux-saga.js.org/ ● https://documenter.getpostman.com/view/2287673/RWM6wrX5 ● https://github.com/infinitered/apisauce ● https://facebook.github.io/react-native/docs/alert.html ● https://github.com/gnestor/react-native-statusbar-alert ● https://www.getpostman.com/ ● https://reactnavigation.org/docs/en/navigation-options-resolution.html

Jump into React-Native (Class 5)