useEvent<T, R> function
Returns a stable callback that always invokes the latest handler.
Unlike useCallback, changing handler never changes the returned
callback's identity. Use a record as T when an event carries multiple
values.
Implementation
StableEventCallback<T, R> useEvent<T, R>(R Function(T value) handler) {
return use(_EventHook<T, R>(handler));
}