Skip to content

hminhman/react-native-set-timer

 
 

Repository files navigation

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);

About

解决react-native 定时器后台锁屏无法运行

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 34.1%
  • Objective-C 31.4%
  • Java 31.1%
  • Ruby 3.4%