nuxt-community / firebase-module

🔥 Easily integrate Firebase into your Nuxt project. 🔥
https://firebase.nuxtjs.org
MIT License
641 stars 98 forks source link

Typescript definition of ReadyFunction not a Promise #524

Open Parakoos opened 3 years ago

Parakoos commented 3 years ago

Version

@nuxtjs/firebase: 7.5.0 firebase: 8.3.1 nuxt: 2.15.3

Reproduction Link

N/A

Steps to reproduce

Navigate to your typescript definition file, @nuxtjs\firebase\types\index.d.ts and look for the ReadyFunction interface.

What is Expected?

According to the documentation for how to use lazy initialization (https://firebase.nuxtjs.org/guide/options#lazy), you are meant to call the ready methods for a service (e.g. await this.$fire.authReady()) and when the promise resolves, the service will have been loaded.

So, I would expect the typescript definition of these ready functions to return a promise.

What is actually happening?

Currently, the ReadyFunction definition returns void.

interface ReadyFunction {
  (): void;
}
lupas commented 3 years ago

Thanks @Parakoos , that is indeed not how it should be. Will fix it when I next find some free time, feel free to submit a PR if you find the time.