listen method
Supply a callback that will be called any time this ActionV2 is
dispatched. A payload of type T
will be passed to the callback if
supplied at dispatch time, otherwise null will be passed. Returns an
ActionSubscription which provides means to cancel the subscription.
Implementation
ActionSubscription listen(dynamic Function(T event) onData) {
_listeners.add(onData);
return ActionSubscription(() => _listeners.remove(onData));
}