import { Plugin } from '@nuxt/types'
import DataProvider from '~/services/data/dataProvider'

const dataProviderPlugin: Plugin = (ctx) => {
  const dataProvider = new DataProvider()
  dataProvider.initCtx(ctx)

  // Déclare un nouvel accesseur de service via le context Nuxt
  ctx.$dataProvider = dataProvider
}

export default dataProviderPlugin
