UNPKG

lml-main

Version:

This is now a mono repository published into many standalone packages.

33 lines 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const actions_1 = require("../../mapping/actions"); const data_1 = require("../../mapping/data"); const center = { type: 'Point', coordinates: { longitude: data_1.defaultBounds.lng, latitude: data_1.defaultBounds.lat, }, }; const initialMapBoundsState = { center, }; exports.mapBoundsReducer = (state = initialMapBoundsState, action) => { switch (action.type) { case actions_1.UPDATE_BOUNDS: { return updateBounds(state, action); } case actions_1.PAN_MAP: { return panMap(state, action); } default: { return state; } } }; // IS IT JUST ME OR ARE THESE 2 ACTIONS DOING THE SAME THING??? const updateBounds = (state, action) => (Object.assign({}, state, { //currentCenter: action.center, center: action.center })); const panMap = (state, action) => (Object.assign({}, state, { center: action.center })); //# sourceMappingURL=bounds.js.map