UNPKG

@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

19 lines (16 loc) 665 B
import { __assign } from 'tslib'; import { Pos } from '@shopify/app-bridge-core/actions'; var defaultPOSStore = {}; function posReducer(state, action) { if (state === void 0) { state = defaultPOSStore; } switch (action.type) { case Pos.Action.LOCATION_UPDATE: return __assign(__assign({}, state), { location: action.payload }); case Pos.Action.USER_UPDATE: return __assign(__assign({}, state), { user: action.payload }); case Pos.Action.DEVICE_UPDATE: return __assign(__assign({}, state), { device: action.payload }); } return state; } export { posReducer as default, defaultPOSStore };