UNPKG

@shopify/app-bridge-core

Version:

**[Join our team and work on libraries like this one.](https://www.shopify.ca/careers)**

38 lines (35 loc) 919 B
import { actionWrapper } from '../helper.js'; import { ActionSet } from '../ActionSet.js'; import { Group } from '../types.js'; /** * Pos action type enum * @remarks includes the action prefix and group * */ var Action; (function (Action) { Action["CLOSE"] = "APP::POS::CLOSE"; Action["LOCATION_UPDATE"] = "APP::POS::LOCATION::UPDATE"; Action["USER_UPDATE"] = "APP::POS::USER::UPDATE"; Action["DEVICE_UPDATE"] = "APP::POS::DEVICE::UPDATE"; })(Action || (Action = {})); function close() { return actionWrapper({ group: Group.Pos, type: Action.CLOSE, }); } class Pos extends ActionSet { constructor(app) { super(app, Group.Pos, Group.Pos); } dispatch(action) { switch (action) { case Action.CLOSE: this.app.dispatch(close()); break; } return this; } } export { Action, Pos, close };