morenoh149 / react-native-contacts

React Native Contacts
MIT License
1.65k stars 564 forks source link

Have `getContactById` also return `null` since it can return a contact or null #713

Closed dprevost-LMI closed 1 year ago

dprevost-LMI commented 1 year ago

getContactById can be a contact or null, so the API definition should be like below

getContactById(contactId: string): Promise<Contact | null>;

It also reflects the documentation about contact being null when it does not exists

getContactById(contactId): Promise - returns contact with defined contactId (or null if it doesn't exist)