Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
firofame authored Aug 8, 2019
1 parent ba672f7 commit 002cbdb
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@
```javascript
import CompassHeading from 'react-native-compass-heading';

// TODO: What to do with the module?
CompassHeading;
useEffect(() => {
const degree_update_rate = 3;

CompassHeading.start(degree_update_rate, degree => {
setCompassHeading(degree);
});

return () => {
CompassHeading.stop();
};
}, []);
```

0 comments on commit 002cbdb

Please sign in to comment.