swsnu / swpp2020-team13

Goaling Ball: Your goal management service.
0 stars 3 forks source link

Change in a way to store objects in reducers in frontend #26

Open ChanwooLucioLee opened 3 years ago

ChanwooLucioLee commented 3 years ago

We have stored objects in an array in reducers in frontend. For example, the initial state of "goals" in goalReducer is [], which is an array.

However, we will start to store objects in an object with its id as a key. For example, goals = [{'id': 1, 'title': 'TITLE1'}, {'id': 2, 'title': 'TITLE2'}] will be stored as goals = {1: {'id': 1, 'title': 'TITLE1'}, {'id': 2, 'title': 'TITLE2'}}

Why is it better?

How to migrate?