pointfreeco / isowords

Open source game built in SwiftUI and the Composable Architecture.
https://www.isowords.xyz
Other
2.7k stars 222 forks source link

Replace FileClient functionality with PersistenceClient (WIP) #169

Closed acosmicflamingo closed 11 months ago

acosmicflamingo commented 1 year ago

After trying to figure out how to handle saving UserSettings in my own app (https://github.com/pointfreeco/swift-composable-architecture/discussions/1384) and reading the discussion about mutable environment states, I thought I'd give it a try to replace FileClient with a new PersistenceClient, which will use UserDefaults in the backend for saving user data.

acosmicflamingo commented 1 year ago

The issues I thought I was seeing actually came from isowords and not my code (which is addressed in https://github.com/pointfreeco/isowords/pull/171) phew :) saving and loading UserSettings works like a charm! Now to update tests to make sure it really does work as intended.

acosmicflamingo commented 1 year ago

Hmm...it looks like there's actually some tests that fail in isowords even without my changes, so it'll be a bit hard for me to be confident that the changes in this PR don't introduce bigger problems.

acosmicflamingo commented 11 months ago

Forgot I made this; quite outdated and useless now.