-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
In version 9.1.0 of Typewriter, it looks like a convenience is generated to create a tracking event with optional values:
func with(
parameter1: String?? = nil,
parameter2: String?? = nil
) -> MyEvent {
return MyEvent(
parameter1: parameter1 ?? self. parameter2,
parameter2: parameter2 ?? self. parameter2
)
}It would be great to have something like this, but more of a static function with default values for optional properties, like:
static func with(
parameter1: String? = nil,
parameter2: String? = nil
) -> MyEvent {
return MyEvent(
parameter1: parameter1,
parameter2: parameter2
)
}This way at the call site I could use MyEvent.with(parameter1: "value") rather than need to pass in nil for all of the properties I know aren't relevant. I could see a case made for wanting to bring attention to all properties at the call site, but at least in my app this would save a lot of unnecessary noise.
Metadata
Metadata
Assignees
Labels
No labels