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

Rename "errorHere()" #23

Open
thetmkay opened this issue Jul 1, 2018 · 3 comments
Open

Rename "errorHere()" #23

thetmkay opened this issue Jul 1, 2018 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@thetmkay
Copy link

thetmkay commented Jul 1, 2018

The fluent API seems to try to mimic natural language, e.g.

 isThis(error)
 .UserNotFoundError(() => ...)
 .NotAProphetError(() => ...)

errorHere(*error*) uses the following construct:

 if(errorHere(error).isNotAProphetError){
   // Do something
 } else if(errorHere(error).isProphetNotFoundWithId){
   // Do something else
 }

would

thisError(error).isNotAProphetError

or

checkError(error).isNotAProphetError

or

queryError(error).isNotAProphetError

be slightly nicer to read?

@theGlenn theGlenn added enhancement New feature or request good first issue Good for newcomers labels Jul 1, 2018
@williamkwao
Copy link

@theGlenn I'll love to work on this as my first open source contribution

@theGlenn
Copy link
Owner

Hey @williamkwao Thanks for your PR. Since it's not a trivial change it would be nice to keep errorHere alongside thisError for now and mark it as @deprecated for people still using the the old api.

@williamkwao
Copy link

Hi @theGlenn. Thanks for the feedback. Great way to not break the API. I'll update the pr accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants