javascript – Removes excessive recurring code from the store and calculated

I have three getters in my store:

getActiveTournaments (state) {
return state.tournaments.data
? state.tournaments.data
.filter (tournament => tournament.state_status === & # 39; in_progress & # 39;)
// sort tournaments by date of creation
.sort ((TournamentA, TournamentB) => TournamentA.created_at - TournamentB.created_at)
: [];
}
getFutureTournaments (state) {
return state.tournaments.data
? state.tournaments.data
.filter (tournament => tournament.state_value ===> promo #)
// sort tournaments by date of creation
.sort ((TournamentA, TournamentB) => TournamentA.created_at - TournamentB.created_at)
: [];
}
getPastTournaments (state) {
return state.tournaments.data
? state.tournaments.data
.filter (tournament => tournament.state_value === & # 39; finished)
// sort tournaments by date of creation
.sort ((TournamentA, TournamentB) => TournamentA.created_at - TournamentB.created_at)
: [];
}

In my component, I have a cursor that accepts an array of three elements, each one first of an array returned by all getters.
I have therefore created a computed property in my component in order to get these elements and then pass them to the cursor: