Jinjinov / Usb.Events

Subscribe to the Inserted and Removed events to be notified when a USB drive is plugged in or unplugged, or when a USB device is connected or disconnected. Usb.Events is a .NET Standard 2.0 library and uses WMI on Windows, libudev on Linux and IOKit on macOS.
MIT License
95 stars 23 forks source link

Use Observer Pattern (IObservable<T>) in place of C# Events (EventHandler<TEventArgs>) #41

Open sonicbhoc opened 5 months ago

sonicbhoc commented 5 months ago

The Observer Pattern allows for multiple subscribers to a single event, and allows for cleaner separation between application layers.

Events are more concrete but tightly-coupled implementations of the Observer Pattern.