@malga-checkout/core
Version:
Core components for Malga Checkout
11 lines (10 loc) • 317 B
JavaScript
import { createStore } from '@stencil/store';
import { SavedCardTypes } from './saved-cards.types';
export const { state, onChange } = createStore({
cards: [],
hasCards: false,
});
onChange('cards', (value) => {
state.hasCards =
value.filter((card) => card.status !== SavedCardTypes.FAILED).length > 0;
});