[Event] convert syntheticEvent and responderSyntheticEvent to record by sgny · Pull Request #694 · rescript-react-native/rescript-react-native

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When SyntheticEvent is included in some event module, type t would also be included and the compiler won't allow types to be redefined. I couldn't come up with a better name, so suggestions are welcome.

Since SyntheticEvent and ResponderSyntheticEvent need to be used to define new events, we can add two modules (such as _SyntheticEvent and _ResponderSyntheticEvent) for all modules to inherit from. Then in SyntheticEvent and ResponderSyntheticEvent we could have type t ('a) = t_('a).