An open API service indexing awesome lists of open source software.

https://github.com/sleeplessbyte/react-native-use-timestamp

Hooks that re-renders every x milliseconds and returns the current timestamp
https://github.com/sleeplessbyte/react-native-use-timestamp

Last synced: 3 months ago
JSON representation

Hooks that re-renders every x milliseconds and returns the current timestamp

Awesome Lists containing this project

README

        

# react-native-use-timestamp

This package provides a hook to give the current timestamp, but only when the application is not running any interactions.

## Installation

```bash
yarn add react-native-use-timestamp
```

Even though this package is _meant_ for the `react-native` ecosystem, it has bundles for CJS, ES, UMD, and modern browsers.

## Usage

```typescript
// Runs callback every number_of_milliseconds
const now = useInaccurateTimestamp(callback, { every: number_of_milliseconds })
```