map0<R> static method

Event<R> map0<R>(
  1. Map0<R> callback
)

Maps the evaluation of the 0-argument callback to an event.

Implementation

// ignore: prefer_constructors_over_static_methods
static Event<R> map0<R>(Map0<R> callback) {
  try {
    return Event<R>.next(callback());
  } catch (error, stackTrace) {
    return Event<R>.error(error, stackTrace);
  }
}