gestalt
Cross-platform configuration and data saving between desktop and web
On desktop, saving is backed by filesystem and APIs and uses the platform-specific data
locations. On web, saving is backed by the LocalStorage browser API.
As an end user, all you need to worry about is which Location
you want to save to:
Cache
, which is short-lived and may not persist between runs of the programConfig
, for storing long-term configurationData
, for storing long-term large data blobs.
To save and load some data:
use ;
use ;
let player1 = Player ;
save.expect;
let player2 = Player ;
save.expect;
// Now reload.
let player1 = .expect;
let player2 = .expect;