Replies: 2 comments
-
Possible improvement in regards to cache invalidationexport const state = () => ({
goals: {
byId: { // Goal actual data mapped to their ID
'idMock': {
goalType: 'Standup',
task: 'Goal store setup',
}
},
byUser: {
isInvalid: false,
expiry: "mock_date",
data: {
'user_Id': [], // Array of id of goals for that user
}
},
byPage: {
isInvalid: false,
expiry: "mock_date",
data: {
1: [], // Array of id of goals in page 1
2: [],
// and so on...
},
},
sortedByDifficulty: {
isInvalid: false,
expiry: "mock_date",
data: [], // Array of id of goals
},
},
}) Points to note
|
Beta Was this translation helpful? Give feedback.
0 replies
-
AlternativeInstead of managing cache our-self, we can use something use https://tanstack.com/query/latest or something similar that does this for us. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Requirement
I'm looking for ways to structure my goal data.
My priority here are -
My solution so far
Here is how I think would be good way of storing the data.
Advantages
byId
only.byId
. (IF no sorting/filtering cache is affected by it)Disadvantage
Beta Was this translation helpful? Give feedback.
All reactions