The event stream has an abort() method that allows us to cancel any event listeners. In order to access this stream outside of the display_event() method we can bind the current active listener to activeStream. A new function stop_stream() is now available for halting either activeStream or any other stream passed to it directly. The active stream is aborted when the selected device is changed.
The event stream has an
abort()
method that allows us to cancel any event listeners. In order to access this stream outside of thedisplay_event()
method we can bind the current active listener toactiveStream
. A new functionstop_stream()
is now available for halting eitheractiveStream
or any other stream passed to it directly. The active stream is aborted when the selected device is changed.This commit also bundles https://github.com/kh90909/OakTerm/issues/40 by adding a terminal print when the selected device is updated.
Reference: https://github.com/kh90909/OakTerm/issues/36