Slide 15
Slide 15 text
© ZOZO Technologies, Inc.
15
{
"status": {
"current": {
"questionIndex": 0,
"deadlineTimeStamp": 1560487021599
}
},
"votes": {
"00mLbY71Rm88Nz11gxAA": {
"questionIndex": 0,
"selectedAnswerIndex": 0
},
"021tVyGd46luzFmrkeQp": {
"questionIndex": 0,
"selectedAnswerIndex": 1
},
"02GH3o3FUuS110IO5ZFX": {
"questionIndex": 1,
"selectedAnswerIndex": 1
},...
}
}
コンポーネント内で扱いやすいように
Vuex Storeとの連携の際に
データ構造を変換
→
statusCollection → statusModule
votesCollection → questionModule
Cloud Firestore
{
status: {
currentQuestionIndex: 0,
deadlineTimeStamp: 1560487021599
},
question: {
questions: [
{
text: '質問テキスト1',
answers: [
{
votesCount: 0,
text: 'YES'
},
{
votesCount: 0,
text: 'NO'
}
]
}...
]
}
}
Vuex Store
FirestoreとVuex Storeの連携