@shopify/app-bridge-host
Version:
App Bridge Host contains components and middleware to be consumed by the app's host, as well as the host itself. The middleware and `Frame` component are responsible for facilitating communication between the client and host, and used to act on actions se
24 lines (19 loc) • 825 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var tslib = require('tslib');
var Actions = require('@shopify/app-bridge-core/actions');
var defaultPOSStore = {};
function posReducer(state, action) {
if (state === void 0) { state = defaultPOSStore; }
switch (action.type) {
case Actions.Pos.Action.LOCATION_UPDATE:
return tslib.__assign(tslib.__assign({}, state), { location: action.payload });
case Actions.Pos.Action.USER_UPDATE:
return tslib.__assign(tslib.__assign({}, state), { user: action.payload });
case Actions.Pos.Action.DEVICE_UPDATE:
return tslib.__assign(tslib.__assign({}, state), { device: action.payload });
}
return state;
}
exports.default = posReducer;
exports.defaultPOSStore = defaultPOSStore;