From 002cbdbcd9ecbed68f4ae79dd8551f77b2995fef Mon Sep 17 00:00:00 2001 From: Firoz Ahmed Date: Thu, 8 Aug 2019 09:40:04 +0530 Subject: [PATCH] Update README.md --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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(); + }; +}, []); ```