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
- Host: GitHub
- URL: https://github.com/sleeplessbyte/react-native-use-timestamp
- Owner: SleeplessByte
- Created: 2021-06-16T20:04:16.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-19T12:24:50.000Z (about 2 years ago)
- Last Synced: 2024-10-18T19:47:30.647Z (8 months ago)
- Language: TypeScript
- Size: 3.71 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
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 })
```