Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typings for PhoneAuthListener is not right #1181

Closed
sowdri opened this issue Jun 6, 2018 · 1 comment
Closed

Typings for PhoneAuthListener is not right #1181

sowdri opened this issue Jun 6, 2018 · 1 comment

Comments

@sowdri
Copy link
Contributor

sowdri commented Jun 6, 2018

Issue

The typings for PhoneAuthListener is not right.

interface PhoneAuthListener {
      on(
        event: string,
        observer: () => PhoneAuthSnapshot,
        errorCb?: () => PhoneAuthError,
        successCb?: () => PhoneAuthSnapshot
      ): PhoneAuthListener;

      then(fn: () => PhoneAuthSnapshot): Promise<any>;

      catch(fn: () => Error): Promise<any>;
    }

The function signature of observer, then and catch should have been the following:

interface PhoneAuthListener {
      on(
        event: string,
        observer: (snapshot: PhoneAuthSnapshot) => void,
        errorCb?: (error: PhoneAuthError) => void ,
        successCb?: (snapshot: PhoneAuthSnapshot) => void
      ): PhoneAuthListener;

      then(fn: (snapshot: PhoneAuthSnapshot) => void): Promise<any>;

      catch(fn: (error: Error) => void): Promise<any>;
    }

Environment

  1. Application Target Platform: Both
  1. Development Operating System: NA
  1. Build Tools: NA
  1. React Native version: NA
  1. RNFirebase Version: 4.2.0
  1. Firebase Module: Auth
@chrisbianca
Copy link
Contributor

Merged #1185 to address this. Thanks for flagging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants