SHARE
TWEET

Untitled

a guest Sep 17th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { put, takeLatest } from 'redux-saga/effects'
  2. import firebase from 'react-native-firebase'
  3. import { SomeAPI } from '../../../config/Api'
  4. import { AlertNotice } from '../../../components'
  5.  
  6. function * WorkerUser ({ data }) {
  7.   try {
  8.     const { token } = data
  9.     const ResSomeAPI = yield SomeAPI({ token })
  10.     if (ResSomeAPI.data.success) {
  11.       yield put({ type: 'DATA_user', data: ResSomeAPI.data.user})
  12.     }
  13.   } catch (error) {
  14.     firebase.crashlytics().log('GetUser.WorkerUser.js')
  15.     firebase.crashlytics().recordError(1, `${error}`)
  16.     AlertNotice(error.response)
  17.   }
  18. }
  19.  
  20. export const watcherUser = [takeLatest('USER_REQUEST', WorkerUser)]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top