ObservableUserDefault
ObservableUserDefault copied to clipboard
Support for optional parameters?
Thanks for this macro. I love the idea of it, which aims to prevent code bloat and typing the same variable name multiple times.
However, it looks like in order to set a default value, you MUST provide all the parameters (key, defaultValue and store). Since the key is the same as the var name and I have no need to provide a custom store, I wish I could simply provide the defaultValue in the init, as follows:
import ObservableUserDefault
@Observable
final class StorageModel {
@ObservableUserDefault(.init(defaultValue: false))
@ObservationIgnored
var showName: Bool
}
Can we hope to have optional parameters support?
Thanks.