diff --git a/README.md b/README.md index c82a643..da12d51 100644 --- a/README.md +++ b/README.md @@ -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(); + }; +}, []); ```