UNPKG

trippler

Version:

A React Router Redux implementation.

26 lines (20 loc) 596 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _rrrActions = require("./rrrActions"); const initialState = { navigateNow: false, navigateTo: "/", navigateFrom: "/" }; const rrrReducer = (state = initialState, action) => { if (action.type === _rrrActions.NAVIGATE_TO) { return Object.assign({}, state, { navigateNow: true, navigateTo: action.navigateTo }); } if (action.type === _rrrActions.NAVIGATE_RESET) { return Object.assign({}, state, { navigateNow: false, navigateTo: '/' }); } return state; }; exports.default = rrrReducer;