Skip to content

Emit event periodically (also when application is running in the background)

License

Notifications You must be signed in to change notification settings

wytrych/react-native-background-timer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Native Background Timer

Emit event periodically (also when application is running in the background).

Currently for Android only.

Instalation

  • npm install react-native-background-timer --save
  • rnpm link

Usage

var {DeviceEventEmitter} = React;
var BackgroundTimer = require('react-native-background-timer');
// start timing
BackgroundTimer.start(5000); // delay in milliseconds
// listen for event
DeviceEventEmitter.addListener('backgroundTimer', () => {
	// this will be executed every 5 seconds
	// also when application is running in the background
	console.log('tic');
});
// you can explicitly stop timing
BackgroundTimer.stop();

About

Emit event periodically (also when application is running in the background)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 95.9%
  • JavaScript 4.1%