-
-
Notifications
You must be signed in to change notification settings - Fork 3
Small Code Samples
First the most basic. State is an in-memory value.
Next is StoredState. It works the exact same as State, but its values are stored in UserDefaults.
SyncState allows the use of iCloud to sync the state across the user's devices for the app.
SecureState is the first feature suggested by a user of AppState. It stores String values using the Keychain! Easily store your tokens or sensitive information using it!
Back to a core feature of AppState.. Dependency is great if you have a service or object you want to share across your app. Dependencies using AppState are initialized once and are initialized just in time when it is first used. Dependencies can also be loaded ahead of time.
Slice and Constant were introduced in 1.5.0 and allow for fine control of AppState values.
Finally while making this post I found out Optionals were not working as I'd like.. So I implemented OptionalSlice and OptionalConstant to allow for values from optional state. Implemented in 1.6.0.
🚧 Under Construction 🚧