UNPKG

@open-tender/cloud

Version:

A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our cloud-based Order API.

35 lines (34 loc) 1.16 kB
"use strict"; var _a; Object.defineProperty(exports, "__esModule", { value: true }); exports.qrReducer = exports.selectQrParams = exports.resetQrParams = exports.setQrParams = void 0; const toolkit_1 = require("@reduxjs/toolkit"); const initialState = { locationId: null, prep_type: null, table: null, service_type: null }; const qrSlice = (0, toolkit_1.createSlice)({ name: 'qr', initialState: initialState, reducers: { setQrParams(state, action) { const { locationId, prep_type, table, service_type } = action.payload; state.locationId = locationId; state.prep_type = prep_type; state.table = table; state.service_type = service_type; }, resetQrParams(state) { state.locationId = null; state.prep_type = null; state.table = null; state.service_type = null; } } }); _a = qrSlice.actions, exports.setQrParams = _a.setQrParams, exports.resetQrParams = _a.resetQrParams; const selectQrParams = (state) => state.qr; exports.selectQrParams = selectQrParams; exports.qrReducer = qrSlice.reducer;