Skip to content

Improve AppError typings #1645

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

Merged
merged 2 commits into from
Mar 28, 2019
Merged

Improve AppError typings #1645

merged 2 commits into from
Mar 28, 2019

Conversation

mmermerkaya
Copy link
Contributor

Randomly noticed this while looking into FirebaseError. This way TS will complain if the errors object is missing any AppError string, or contains a string that is not in AppError.

I'd still recommend using a const enum instead of a union type as AppError though.

@Feiyang1
Copy link
Member

Thanks very much! I updated it to use enum in the app-v6 branch. Also PR is welcomed ! <3

@mmermerkaya
Copy link
Contributor Author

Oh awesome, haha I didn't even realize we had that branch. I guess there's no need to switch to enums here since this will go away soon enough.

@mmermerkaya mmermerkaya merged commit 18aecbc into master Mar 28, 2019
@mmermerkaya mmermerkaya deleted the mmermerkaya-app-error-typings branch March 28, 2019 19:00
@firebase firebase locked and limited conversation to collaborators Oct 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants