kberg / terraforming-mars

Terraforming Mars Boardgame
GNU General Public License v3.0
1 stars 0 forks source link

one way to do asynchronous saves #25

Closed bafolts closed 2 years ago

bafolts commented 2 years ago

This is one approach for dealing with the async save problem that exists. Eventually we need to re-factor the Game.newInstance function to either return a promise which resolves once we have saved the game in the database or a callback argument which is called once the game is saved in the database. This will require a lot of unit tests to be updated. For the time being this change modified the IDatabase instance only for the SQLite unit test so that we know when the call to saveGame has finished.