aretherecookies-mobile/js/enhancers/mapViewEnhancers.js
2017-09-09 13:10:55 -05:00

16 lines
434 B
JavaScript

// @flow
import { compose, withState } from 'recompose';
import { path } from 'ramda';
import { withLocation } from './locationEnhancers';
export const withRegionState = compose(
withLocation,
withState('region', 'onRegionChange', ({ location }) => {
return {
latitude: path(['coords', 'latitude'], location),
longitude: path(['coords', 'longitude'], location),
latitudeDelta: 0.07,
longitudeDelta: 0.07,
};
})
);