Skip to content

🎧 MusicProviderWithPersistence — Redux Store with Persistence ​

MusicProviderWithPersistence ensures that critical audio control states like History, Favourites, and Volume are automatically preserved across sessions. This allows users to seamlessly resume their listening experience without losing their preferences.


📚 What It Stores ​

By default, the following parts of the state are persisted:

  • 🎵 history — Keeps a record of recently played tracks.
  • ❤️ favourites — Stores user's liked or saved songs.
  • 🔊 volume — Retains the user's preferred volume level.

How to Use ​

To get started, wrap your application with the <MusicProviderWithPersistence /> component, which is exported directly from the package.

tsx
import React from "react"
import ReactDOM from "react-dom/client"
import App from "./App"
import { MusicProviderWithPersistence } from "your-package-name"

const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement)

root.render(
  <MusicProviderWithPersistence>
    <App />
  </MusicProviderWithPersistence>
)

just a timepass anyways