const pidMixin = { props: { pid: { type: Number, required: true, validator: prop => typeof prop === 'number' || prop === null, }, }, } const cardMixin = { data: () => ({ cards: [], matches: [], loading: true, }), watch: { /** Fetch the queue if pid changes */ pid() { this.getCards() }, }, async created() { await this.getCards() }, methods: { _reformat(data, mapCb) { return data.map(mapCb) }, }, } export { pidMixin, cardMixin }