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

36 lines (33 loc) 945 B
import { FeedbackModal } from '@shopify/app-bridge-core/actions'; import { validateAction } from '@shopify/app-bridge-core/validate/actions/feedbackModal'; var defaultStore = null; function reducer(state, action) { if (state === void 0) { state = defaultStore; } var castedAction = action; if (validateAction(castedAction)) { return state; } switch (action.type) { case FeedbackModal.Action.OPEN: { var _a = action.payload, formId = _a.formId, id = _a.id; return { id: id, formId: formId, }; } case FeedbackModal.Action.CLOSE: return null; default: return state; } } var feature = { actions: { open: FeedbackModal.open, close: FeedbackModal.close, }, key: 'feedbackModal', initialState: defaultStore, reducer: reducer, }; export { feature, reducer };