map<T, V> static method
This is a convenience factory to create an event which is transformed by some function that, usually, needs the store state. You must provide the event and a map-function. The map-function must be able to deal with the spent state (null or false, accordingly).
For example, if state.indexEvt = Event<int>(5)
and you must get
a user from it:
var mapFunction = (int index) => index == null ? null : state.users[index];
Event<User> userEvt = Event.map(state.indexEvt, mapFunction);
Implementation
static Event<T> map<T, V>(Event<V> evt, T? Function(V?) mapFunction) =>
MappedEvent<V, T>(evt, mapFunction);