calloutPress (location) { /* *********************************************************** * STEP 5 * Configure what will happen (if anything) when the user * presses your callout. *************************************************************/ console.tron.log(location) }
function* fetchPodcasts() { try { const { data } = yield call(api.get, 'podcasts'); yield put(Creators.fetchPodcastsSuccess(data)); } catch (err) { console.tron.log("Error fetchPodcasts") } }
export function fetchDataFasksesRsKhusus() { return (dispatch) => { dispatch(getDataFaskes()); dispatch(setScreenOpen()); this.api.fetchKhusus().then((result) => { console.tron.log('rs khusus'); dispatch(getDataFaskesSuccess(result.data)); dispatch(setScreenClose()); }).catch((err) => { dispatch(getDataFaskesFailed(err)); console.tron.log(err); }); }; }
render() { const { taskId, onClickToggle } = this.props console.tron.log(onClickToggle) return ( <View style={{ flex: 1 }}> <TouchableOpacity onPress={() => { onClickToggle(taskId) }} style={{ flex: 1 }} > <Text style={{ margin: 20, color: this.props.completed == true ? 'darkgreen' : 'black' }}> {this.props.taskName} </Text> </TouchableOpacity> </View>); }
const screenTracking = ({ getState }) => next => (action) => { if ( action.type !== NavigationActions.NAVIGATE && action.type !== NavigationActions.BACK ) { return next(action) } const currentScreen = getCurrentRouteName(getState().nav) const result = next(action) const nextScreen = getCurrentRouteName(getState().nav) if (nextScreen !== currentScreen) { try { console.tron.log(`NAVIGATING ${currentScreen} to ${nextScreen}`) // Example: Analytics.trackEvent('user_navigation', {currentScreen, nextScreen}) } catch (e) { console.tron.log(e) } } return result }
function* setPodcast({ podcast, episodeId }) { try { const currentPodcast = yield select(state => state.player.podcast); if (!currentPodcast || episodeId !== currentPodcast.id) { yield call(TrackPlayer.stop); yield call(TrackPlayer.reset); yield call(TrackPlayer.add, [...podcast.tracks]); yield put(PlayerActions.setPodcastSuccess(podcast)); } if (episodeId) { yield call(TrackPlayer.skip, episodeId); yield put(PlayerActions.setCurrent(episodeId)); } yield put(PlayerActions.play()); yield call(trackChanged) } catch (error) { console.tron.log("Error setPodcast"); } }
componentWillReceiveProps (nextProps) { if (!nextProps.addUser.fetching && this.state.isFetching && !this.state.isEdit) { if (nextProps.addUser.payload) { this.props.navigation.dispatch(NavigationActions.back({key: null})) } if (nextProps.addUser.error) { console.tron.warn('error') } this.setState({isFetching: false}) } if (!nextProps.editUser.fetching && this.state.isFetching && this.state.isEdit) { if (nextProps.editUser.payload) { this.props.navigation.dispatch(NavigationActions.back({key: null})) } if (nextProps.editUser.error) { console.tron.warn('error') } this.setState({isFetching: false}) } }
export function* updateProfile({ payload }) { try { const { name, email, avatar_id, ...rest } = payload.data; const profile = { name, email, avatar_id, ...(rest.oldPassword ? rest : {}), }; const response = yield call(api.put, 'users', profile); toast.success('Perfil atualizado com sucesso!'); yield put(updateProfileSuccess(response.data)); } catch (error) { console.tron.log(error); toast.error('Erro ao atualizar Perfil'); yield put(updateProfilefailure()); } }
export function fetchDataFasksesPuskesmas() { return (dispatch) => { dispatch(getDataFaskes()); dispatch(setScreenOpen()); this.api.fetchPuskesmas().then((result) => { console.tron.log('puskesmas'); dispatch(getDataFaskesSuccess(result.data)); dispatch(setScreenClose()); }).catch((err) => { dispatch(getDataFaskesFailed(err)); console.tron.log(err); }); }; }
export function fetchDataFasksesRsUmum(){ return (dispatch) => { dispatch(getDataFaskes()); dispatch(setScreenOpen()); this.api.fetchUmum().then((result) => { console.tron.log('rs umum'); dispatch(getDataFaskesSuccess(result.data)); dispatch(setScreenClose()); }).catch((err) => { dispatch(getDataFaskesFailed(err)); console.tron.log(err); }); }; }
calloutPress (location) { /* *********************************************************** * STEP 5 * Configure what will happen (if anything) when the user * presses your callout. *************************************************************/ console.tron.log(location) }
constructor(props) { super(props) console.tron.log(props) }
const screenTracking = ({ getState }) => next => (action) => { if ( action.type !== NavigationActions.NAVIGATE && action.type !== NavigationActions.BACK ) { return next(action) } const currentScreen = getCurrentRouteName(getState().nav) const result = next(action) const nextScreen = getCurrentRouteName(getState().nav) if (nextScreen !== currentScreen) { try { console.tron.log(`NAVIGATING ${currentScreen} to ${nextScreen}`) // Example: Analytics.trackEvent('user_navigation', {currentScreen, nextScreen}) } catch (e) { console.tron.log(e) } } return result }
const screenTracking = ({ getState }) => next => (action) => { if ( action.type !== NavigationActions.NAVIGATE && action.type !== NavigationActions.BACK ) { return next(action) } const currentScreen = getCurrentRouteName(getState().nav) const result = next(action) const nextScreen = getCurrentRouteName(getState().nav) if (nextScreen !== currentScreen) { try { console.tron.log(`NAVIGATING ${currentScreen} to ${nextScreen}`) // Example: Analytics.trackEvent('user_navigation', {currentScreen, nextScreen}) } catch (e) { console.tron.log(e) } } return result }
const screenTracking = ({ getState }) => next => (action) => { if ( action.type !== NavigationActions.NAVIGATE && action.type !== NavigationActions.BACK ) { return next(action) } const currentScreen = getCurrentRouteName(getState().nav) const result = next(action) const nextScreen = getCurrentRouteName(getState().nav) if (nextScreen !== currentScreen) { try { console.tron.log(`NAVIGATING ${currentScreen} to ${nextScreen}`) // Example: Analytics.trackEvent('user_navigation', {currentScreen, nextScreen}) } catch (e) { console.tron.log(e) } } return result }