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

contact.service.ts Promise issue #7

Closed
rae89 opened this issue Aug 1, 2017 · 2 comments
Closed

contact.service.ts Promise issue #7

rae89 opened this issue Aug 1, 2017 · 2 comments

Comments

@rae89
Copy link

rae89 commented Aug 1, 2017

Hello, I am receiving the following types of error in the contact.service.ts script. I am receiving four different errors of these type one for each of the following methods getContacts(), createContact(...), deleteContact(...), updateContact(...). I am using visual code, which is how I identified the error below.

severity: 'Error'
message: 'Type 'Promise<void | Contact[]>' is not assignable to type 'Promise<Contact[]>'.
Type 'void | Contact[]' is not assignable to type 'Contact[]'.
Type 'void' is not assignable to type 'Contact[]'.'
at: '17,7'
source: 'ts'

@tfogo
Copy link
Collaborator

tfogo commented Aug 2, 2017

Hey,

Good catch! Looks like handleError returns <void>. Since handleError catches errors in the promises, the promise types should be <void | Contact[]> etc.

So you should be safe to just edit your file to correct this. (See the fix here)

@chrisckchang, PR to fix this incoming.

@chrisckchang
Copy link
Owner

chrisckchang commented Aug 2, 2017

@rae89 PR here: #8. can you please confirm it works for you?

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

3 participants