You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Player saved data including stats and saved paintings are currently saved using Window.localStorage.
Currently, the API calls to set and retrieve these saved items are scattered throughout the code base. This is really problematic because it litters implicit assumptions about the structure of these saved objects throughout the entire project - which is inevitably going to come back to bite us long-term.
Possible Solution
Ideally, it would be awesome to extract and encapsulate all of the Window.localStorage related source code into a single utility, which would not only simplify the code base overall, but would make it easy to move to another form of storage in the future.
Current Blocker
I've taken a couple attempts at this so far, and don't really like how any of them have turned out yet. For example, I'd like it to work consistently with caller expectations, but having trouble with calls such as...
// this would be ideal
let painting = Painting.create();
DataStore.paintings.push(painting)
... which would be much less error prone for callers than having to explictly use the DataStore's setter:
// this is as close as I'm getting
let painting = Painting.create();
DataStore.paintings = DataStore.paintings.push(painting);
Anyway, leave this alone for now and think about it a little more...
The text was updated successfully, but these errors were encountered:
Problem
Player saved data including stats and saved paintings are currently saved using Window.localStorage.
Currently, the API calls to set and retrieve these saved items are scattered throughout the code base. This is really problematic because it litters implicit assumptions about the structure of these saved objects throughout the entire project - which is inevitably going to come back to bite us long-term.
Possible Solution
Ideally, it would be awesome to extract and encapsulate all of the
Window.localStorage
related source code into a single utility, which would not only simplify the code base overall, but would make it easy to move to another form of storage in the future.Current Blocker
I've taken a couple attempts at this so far, and don't really like how any of them have turned out yet. For example, I'd like it to work consistently with caller expectations, but having trouble with calls such as...
... which would be much less error prone for callers than having to explictly use the DataStore's
setter
:Anyway, leave this alone for now and think about it a little more...
The text was updated successfully, but these errors were encountered: