There are two issues present with the map method today:
Its return type is widened to Attr
It does not propagate all of the properties of the current Event
This means, e.g., if you want to use a pattern where sub-components use their own internal message type which then gets mapped in the parent, events do not map cleanly.
This PR fixes the issues by using the copy method. I have extended the usage of copy to the other, similar map methods, as well, to future-proof in case additional parameters are added to these other attribute classes as seems to have been the case with Event.
There are two issues present with the map method today:
This means, e.g., if you want to use a pattern where sub-components use their own internal message type which then gets mapped in the parent, events do not map cleanly.
This PR fixes the issues by using the
copy
method. I have extended the usage ofcopy
to the other, similarmap
methods, as well, to future-proof in case additional parameters are added to these other attribute classes as seems to have been the case with Event.