Closed oskarek closed 1 month ago
I had a recent need to do some cache validation before retrieving the value (drop the file if it was created before some date). I wonder if instead of just focusing on codable this should go as far for loading/writing from/to URL.
I'd love to ear about how to make a composable wrapper to handle caching too
@oskarek Thanks for taking the time to PR! We do think that supporting more than JSON is a good idea but haven't had time to review yet and think about the API. Hopefully soon!
This PR generalizes the
fileStorage
persistence key so that it can be used with values that are notCodable
, by adding the ability to provide custom decode/encode closures as parameters. Also, forCodable
values, the json decoder/encoder can now be customized.