Convert MIDIManager
to global singleton
#200
Labels
🎩 refinement
An enhancement to an existing feature
MIDIManager
to global singleton
#200
Proposal
There are numerous arguments in favor of making
MIDIManager
an implicit global singleton rather than something that has to be instanced.The core benefits:
The conceivable use cases of creating more than one manager instance is almost zero. The only area where it becomes useful is in unit testing, where it could be possible to retain the ability to instance multiple managers internally. (For example, tests involving sending events to/from legacy Core MIDI API to a receiver using new API which requires two managers.)
Current Implementation
Suggested Implementation
Or the two could be combined:
Considerations
MIDIManager
andObservableMIDIManager
. These may need to be merged or the former deprecated.ObservableMIDIManager
can be used as an observable object in SwiftUI views while it is a global singleton, without it being installed in anApp
orView
struct.The text was updated successfully, but these errors were encountered: