@seventytwodays/react-native-volume-listener

0.3.0 • Public • Published

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

Package Sidebar

Install

npm i @seventytwodays/react-native-volume-listener

Weekly Downloads

36

Version

0.3.0

License

MIT

Unpacked Size

723 kB

Total Files

50

Last publish

Collaborators

  • cjpete