Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chenng/react-native-shake-event

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chenng/react-native-shake-event

Add shake event to your React Native app

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Source

author: Jadson Lourenco jadsonlourenco@gmail.com

homepage: https://github.com/jadsonlourenco/react-native-shake-event

Notes: Source can not be used directly, republish it...


Add the shake event on your React Native app, giving to users improved usability. Enjoy! (works only on real device)

Install

$ npm install @chenng/react-native-shake-event --save

Linking Libraries

react-native link @chenng/react-native-shake-event

Usage

import RNShakeEvent from 'react-native-shake-event';

class MyComponent extends React.Component {
  componentWillMount() {
    RNShakeEvent.addEventListener('shake', () => {
      console.log('Device shake!');
    });
  }

  componentWillUnmount() {
    RNShakeEvent.removeEventListener('shake');
  }
}

API

RNShakeEvent

addEventListener('shake', Function)

Start listening the shake event and handle a callback function.

removeEventListener('shake', Function)

Stop to listening the shake event, and is recommended to prevent memory leak.

Issues

On debug mode this event also handle the DevMenu, but works fine on production.

License

MIT

Keywords

FAQs

Package last updated on 08 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc