@malga-checkout/core
Version:
Core components for Malga Checkout
20 lines (16 loc) • 508 B
JavaScript
import { c as createStore } from './settings-1f06ff60.js';
var SavedCardTypes;
(function (SavedCardTypes) {
SavedCardTypes["ACTIVE"] = "active";
SavedCardTypes["FAILED"] = "failed";
SavedCardTypes["PENDING"] = "pending";
})(SavedCardTypes || (SavedCardTypes = {}));
const { state, onChange } = createStore({
cards: [],
hasCards: false,
});
onChange('cards', (value) => {
state.hasCards =
value.filter((card) => card.status !== SavedCardTypes.FAILED).length > 0;
});
export { state as s };