# listen abstract method

StreamSubscription<ObsEvent> listen(

1. void onData(
   1. ObsEvent
   )

)

Subscribe to change events.

Events include:

- ValueChanged
- ListChange
- MapChange
- BulkChange

Returns a StreamSubscription that you should cancel when no longer needed.

### Example

    final obs = Obs<String>('hello');
    final sub = obs.listen((event) {
      print('Observed: $event');
    });

    obs.set('world');
    sub.cancel();

## Implementation

    StreamSubscription<ObsEvent> listen(void Function(ObsEvent) onData);