@seventytwodays/react-native-volume-listener
v0.3.0
Published
Listen to changes in volume output
Downloads
327
Readme
react-native-volume-listener
Listen to changes in volume output
Installation
npm install @seventytwodays/react-native-volume-listener
Usage
import { useState, useEffect } from 'react';
import { addVolumeListener } from '@seventytwodays/react-native-volume-listener';
// ...
const [volume, setVolume] = useState(null);
useEffect(() => {
const listener = addVolumeListener((result) => {
setVolume(result.volume);
});
return () => listener.remove();
}, []);
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library