Skip to content

Commit

Permalink
Update usage-filestate.md (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xLeif authored Oct 5, 2024
1 parent bee1dd5 commit 39f88b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions documentation/usage-filestate.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ struct UserProfile: Codable {
}

extension Application {
@MainActor
var userProfile: FileState<UserProfile> {
fileState(filename: "userProfile", initial: UserProfile(name: "Guest", age: 25))
fileState(initial: UserProfile(name: "Guest", age: 25), filename: "userProfile")
}
}

Expand All @@ -52,8 +53,9 @@ import AppState
import SwiftUI

extension Application {
@MainActor
var largeDataset: FileState<[String]> {
fileState(filename: "largeDataset", initial: [])
fileState(initial: [], filename: "largeDataset")
}
}

Expand Down

0 comments on commit 39f88b8

Please sign in to comment.