Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anisjonischkeit/bs-react-native-contacts
https://github.com/anisjonischkeit/bs-react-native-contacts
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/anisjonischkeit/bs-react-native-contacts
- Owner: anisjonischkeit
- Created: 2020-01-20T00:04:35.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T05:18:55.000Z (almost 2 years ago)
- Last Synced: 2023-03-07T15:18:34.544Z (over 1 year ago)
- Language: C++
- Size: 2.22 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
π¨π¨THIS IS EXPERIMENTAL.π¨π¨
The types are based on the index.d.ts spec found in the react-native-contacts project however I haven't tested the full surface area of this library so if you find any problems let me know.
# bs-react-native-contacts
[react-native-contacts](http://npm.im/react-native-contacts) bindings for [BuckleScript](https://bucklescript.github.io) in [Reason](https://reasonml.github.io).
# Installation
```
yarn add bs-react-native-contacts
```# Usage
Usage is the same as that of the [react-native-contacts](http://npm.im/react-native-contacts) library with a slight difference. Where the original library has callbacks that look like:
```javascript
Contacts.getAll((err, contacts) => {
if (err) {
throw err;
}
// you can now use contacts
});
```these bindings wrap the result in a result type:
```reasonml
open Belt.Result;Contacts.getAll(result => switch(result) {
| Ok(contacts) => // you can use contacts here
| Error(msg) => // you can see the error message here
})
```## Basic Usage
see [test/Example.re](test/Example.re)