supabase-community / nuxt-supabase

A supa simple wrapper around Supabase.js to enable usage within Nuxt.
https://supabase.io
MIT License
167 stars 17 forks source link

Add module declaration with supabase as a type #2

Closed sduduzog closed 3 years ago

sduduzog commented 3 years ago

What kind of change does this PR introduce?

This simply adds a supabase type definition to the vuex store interface. When the SupabaseClient is injected, it is also made available to the store context i.e. actions, mutations but my editor doesn't know that.

What is the current behavior?

Red squigly lines as saying supabase is unknown or not defined when used inside of either an action or mutation

Please link any relevant issues here.

What is the new behavior?

No type error, and autocomplete, thanks to typescript

Feel free to include screenshots if it includes visual changes. image

Additional context

Add any other context or screenshots.

scottrobertson commented 3 years ago

Thank you @sduduzog