gavination / Tremor-Trainer

2 stars 0 forks source link

Gabauman/accelerometervm refactor #20

Closed gavination closed 3 years ago

gavination commented 3 years ago

Addresses issues #16 and #17.

[x] Moves the Accelerometer device feature access code to its own Service [x] Moves the Timer access code to its own Service

Spike Learnings

As these services run on background threads, it makes sense that they have their logic wrapped up in their own classes. Exposed via interfaces so that we may mock them when needed to test the view model state transition logic. Events are emitted from these services and subscribed to in the view model, allowing the view model's responsibility to be more aligned to the UI thread.