Skip to content

why it doesn't work in this situation #339

Description

@ihoudf

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)
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions