UNPKG

@patternplate/client

Version:

Universal javascript client application for patternplate

39 lines (29 loc) 660 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _lodash = require("lodash"); var _reduxActions = require("redux-actions"); var _actions = require("../actions"); const defaultValue = { height: 0, width: 0 }; var _default = (0, _reduxActions.handleActions)({ [_actions.windowResize]: onWindowResize }, defaultValue); exports.default = _default; function onWindowResize(state, { payload }) { const next = { width: payload.width, height: payload.height }; if (!(0, _lodash.isEqual)(next, state)) { return next; } return state; } //# sourceMappingURL=window.js.map