1.0.2 • Published 4 years ago

react-native-set-timer v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

react-native-set-timer

This library provides setTimeout and setInterval implementations that keep working even if the app is running in the background or the screen is locked.

Features

  • Clear and simple API

Install

yarn add react-native-set-timer

Usage

import Timer from "react-native-set-timer";

// Start a timer 
const intervalId = Timer.setInterval(() => console.log(""), 500);

// Cancel the timer 
Timer.clearInterval(intervalId);

// Start a timer t
const timeoutId = Timer.setTimeout(() => console.log("tic"), 500);

// Cancel the timer 
Timer.clearTimeout(timeoutId);