E-Kuerschner / useAudioPlayer

React hooks for controlling audio on the web
MIT License
315 stars 35 forks source link

Refactor state management to decouple from Howler #135

Open E-Kuerschner opened 8 months ago

E-Kuerschner commented 8 months ago

To future proof the library while preserving the API, we should introduce a strict abstraction layer and a concrete implementation layer for the state management. This could help if we ever need to swap Howler out with a different sound engine or a custom implementation.

From comments in code: // TODO: the main state reducer should be decoupled from Howler // to accomplish this, each action should describe the type of change using an abstraction rather than passing in the howl