//
//  action types
//

export const REQUEST_BUS_STOPS_AROUND_ME = 'REQUEST_BUS_STOPS_AROUND_ME'

//
// other constants
//

export loadingState = false

//
//  action creators
//

export function requestBusStopsAroundMe(meters, coors) {
  return {
    type: REQUEST_BUS_STOPS_AROUND_ME,
    text: 'get all the routes and bus stops around user geolocalization',
    meters: meters,
    latitude: coors.laitude,
    longitude: coors.longitude
  }
}

@@ -1,20 +1,110 @@
+import %7B routeActions %7D from 'react-router-redux';%0Aimport fetch from 'isomorphic-fetch';%0A%0A
 //%0A//  action types%0A
@@ -96,16 +96,17 @@
   action
+s
  types%0A/
@@ -192,90 +192,287 @@
 %0A// 
-other constants%0A//%0A%0Aexport loadingState = false%0A%0A//%0A//  action creators%0A//%0A%0Aexport
+ actions helpers%0A//%0A%0Afunction requestBusStopsAroundMe( coors, meters ) %7B%0A  fetch( 'secret-depths-4660.herokuapp/paradas?lt=' + coors.latitude + '&ln=' + coors.longitude + '&r=' + meters )%0A    .then( function()%7B%0A      dispatch( routeActions.push( '/loading' ) );%0A    %7D)%0A    .then(
  fun
@@ -480,256 +480,757 @@
 tion
+(
  re
-questBusStopsAroundMe(meters, coors) %7B%0A  return %7B%0A    type: REQUEST_BUS_STOPS_AROUND_ME,%0A    text: 'get all the routes and bus stops around user geolocalization',%0A    meters:
+sponse ) %7B%0A      if ( response.status %3E= 400 ) %7B%0A        dispatch( routeActions.push( '/errors' ) );%0A        return %7B%0A          meters: meters,%0A          coors: coors,%0A          busStops: %7B%7D,%0A          error: %7B%0A            type: response.status,%0A            message: response.message%0A          %7D%0A        %7D%0A      %7D%0A      dispatch( routeActions.push( '/results' ) );%0A      return %7B%0A        meters: meters,%0A        coors: coors,%0A        busStops: response.json(),%0A        error: %7B%7D%0A      %7D%0A    %7D)%0A%7D%0A%0A//%0A//  actions creators%0A//%0A%0Aexport function getBusStopsAroundMe( coors,
  meters
-,%0A    latitude: coors.laitude,%0A    longitude: coors.longitud
+ ) %7B%0A  var busStopsApiResponse = requestBusStopsAroundMe( coors, meters );%0A  return %7B%0A    type: REQUEST_BUS_STOPS_AROUND_ME,%0A    busStopsAroundMe: busStopsApiRespons
 e%0A  %7D
+;
 %0A%7D%0A

switch to ES6 syntax and add new helpers