CodableDatastore
CodableDatastore copied to clipboard
Support static properties for default disk stores
It would be much nicer to get a single common instance when getting the default store:
extension DiskPersistence where AccessMode == ReadWrite {
/// The default persistence for the read-write store of an app.
public static var `default`: DiskPersistence<AccessMode> = ...
}
extension DiskPersistence where AccessMode == ReadOnly {
/// The default persistence for the read-only store of an app.
public static var readOnlyDefault: DiskPersistence<AccessMode> = self.default.readOnly
}
However, the default URL helper cannot through in that case, specifically on Linux, and we must have a way from converting from a read-write store to a read-only one.
Depends on:
- #15
- #16