firebase-module icon indicating copy to clipboard operation
firebase-module copied to clipboard

Typescript definition of ReadyFunction not a Promise

Open Parakoos opened this issue 3 years ago • 1 comments

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;
}

Parakoos avatar May 13 '21 17:05 Parakoos

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.

lupas avatar Jun 11 '21 22:06 lupas