refactor(client): remove useless questions getters

pull/12/head
sundowndev 2019-12-07 16:02:02 +01:00
parent 7a040bdbe6
commit 7c9fa6ae1d
4 changed files with 9 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -22,15 +22,17 @@ export default Vue.extend({
name: 'Quiz',
props: {},
computed: {
...mapGetters('schools', ['schools']),
...mapGetters('questions', [
...mapState('questions', [
'questions',
'index',
'score',
]),
...mapGetters('questions', [
'currentQuestion',
'checkAnswer',
'isLastQuestion',
]),
...mapGetters('schools', ['schools']),
},
methods: {
answer(answer: number): void {

View File

@ -21,15 +21,6 @@ IStoreQuestions,
questions: [],
},
getters: {
index(state): number {
return state.index;
},
score(state): number {
return state.score;
},
questions(state): IQuestion[] {
return state.questions;
},
currentQuestion(state): IQuestion | {} {
return state.questions.length ? state.questions[state.index] : {};
},

View File

@ -21,7 +21,11 @@ export default Vue.extend({
ScoreScreen,
},
computed: {
...mapGetters('questions', ['index', 'questions', 'score']),
...mapState('questions', [
'questions',
'index',
'score',
]),
},
created(): void {
if (this.index === 0) {