mirror of
https://gitlab.com/wheres-the-tp/ui-mobile.git
synced 2026-01-25 05:54:56 -06:00
16 lines
434 B
JavaScript
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,
|
|
};
|
|
})
|
|
);
|