Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why it doesn't work in this situation #339

Open
ihoudf opened this issue Dec 11, 2024 · 0 comments
Open

why it doesn't work in this situation #339

ihoudf opened this issue Dec 11, 2024 · 0 comments

Comments

@ihoudf
Copy link

ihoudf commented Dec 11, 2024

let diskConfig = DiskConfig(name: "Floppy")
let memoryConfig = MemoryConfig(expiry: .never)

    let storage = try? Storage<String, Data>(
        diskConfig: diskConfig,
        memoryConfig: memoryConfig,
        fileManager: FileManager.default,
        transformer: TransformerFactory.forData()
    )
    
    let user2 = User(firstName: "J222ohdsdsdn", lastName: "Sdsdsdsdnow")
    
    let customStorage = storage?.transformCodable(ofType: User.self)
    customStorage?.async.setObject(user2, forKey: "cityfd") { result in
        let ddfs = try? storage?.object(forKey: "cityfd")
        print(ddfs)
        switch result {
        case .success():
            print("saved successfully")
        case .failure(let error):
            print(error.localizedDescription)
        }
    }
@ihoudf ihoudf changed the title why it doesn't work in this sititation why it doesn't work in this situation Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant