Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-timing-hooks

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-timing-hooks - npm Package Compare versions

Comparing version 2.2.3 to 3.0.0

dist/testing/advanceTimersUsingAct.d.ts

19

CHANGELOG.md

@@ -5,2 +5,21 @@ # Changelog

## [3.0.0](https://github.com/EricLambrecht/react-timing-hooks/compare/v2.2.3...v3.0.0) (2022-12-09)
### ⚠ BREAKING CHANGES
Support for Node 10 and 12 was dropped (since they already reached EOL).
However, the API itself has **no** breaking changes, so it should be safe to update as long as you use Node 14 or higher!
### Features
* **react:** Add official support for React 18 ([cf7114f](https://github.com/EricLambrecht/react-timing-hooks/commit/cf7114fd485a4c7a1f07cf57a1ef946a193d34de))
### ci
* 🚀 Do not test Node 10 and 12 anymore, add tests for Node 18 ([2f2a670](https://github.com/EricLambrecht/react-timing-hooks/commit/2f2a670e11db69ef7204f44d5eea1f51995ce4ab))
### [2.2.3](https://github.com/EricLambrecht/react-timing-hooks/compare/v2.2.2...v2.2.3) (2022-02-19)

@@ -7,0 +26,0 @@

2

dist/animation-frame/types.d.ts

@@ -1,1 +0,1 @@

export declare type AnimationFrameHandle = ReturnType<typeof requestAnimationFrame>;
export type AnimationFrameHandle = ReturnType<typeof requestAnimationFrame>;

@@ -1,10 +0,10 @@

export declare type IdleCallbackCreator = (callback: (deadline: RequestIdleCallbackDeadline) => unknown, options?: RequestIdleCallbackOptions) => RequestIdleCallbackHandle;
export declare type IdleCallbackEffectCallback = (requestIdleCallback: IdleCallbackCreator) => void | (() => void | undefined);
export declare type RequestIdleCallbackHandle = number;
export declare type RequestIdleCallbackOptions = {
export type IdleCallbackCreator = (callback: (deadline: RequestIdleCallbackDeadline) => unknown, options?: RequestIdleCallbackOptions) => RequestIdleCallbackHandle;
export type IdleCallbackEffectCallback = (requestIdleCallback: IdleCallbackCreator) => void | (() => void | undefined);
export type RequestIdleCallbackHandle = number;
export type RequestIdleCallbackOptions = {
timeout: number;
};
export declare type RequestIdleCallbackDeadline = {
export type RequestIdleCallbackDeadline = {
readonly didTimeout: boolean;
timeRemaining: () => number;
};

@@ -1,8 +0,2 @@

import { RequestIdleCallbackDeadline, RequestIdleCallbackHandle, RequestIdleCallbackOptions } from './types';
declare global {
interface Window {
requestIdleCallback: (callback: (deadline: RequestIdleCallbackDeadline) => unknown, options?: RequestIdleCallbackOptions) => RequestIdleCallbackHandle;
cancelIdleCallback: (handle: RequestIdleCallbackHandle) => void;
}
}
import { RequestIdleCallbackOptions } from './types';
/**

@@ -12,3 +6,3 @@ * @param callback The callback that is invoked as soons as the browser invokes the idle callback

*/
declare const useIdleCallback: <T extends (...args: never[]) => unknown>(callback: T, options?: RequestIdleCallbackOptions | undefined) => (...args: Parameters<T>) => void;
declare const useIdleCallback: <T extends (...args: never[]) => unknown>(callback: T, options?: RequestIdleCallbackOptions) => (...args: Parameters<T>) => void;
export default useIdleCallback;
import { DependencyList } from 'react';
import { RequestIdleCallbackHandle, IdleCallbackEffectCallback, RequestIdleCallbackDeadline, RequestIdleCallbackOptions } from './types';
declare global {
interface Window {
requestIdleCallback: (callback: (deadline: RequestIdleCallbackDeadline) => unknown, options?: RequestIdleCallbackOptions) => RequestIdleCallbackHandle;
cancelIdleCallback: (handle: RequestIdleCallbackHandle) => void;
}
}
import { IdleCallbackEffectCallback } from './types';
declare const useIdleCallbackEffect: (effect: IdleCallbackEffectCallback, deps: DependencyList) => void;
export default useIdleCallbackEffect;

@@ -1,3 +0,3 @@

export declare type TimeoutCreator = (handler: () => unknown, timeout: number) => any;
export declare type TimeoutId = ReturnType<typeof setTimeout>;
export declare type TimeoutEffectCallback = (timeoutFunc: TimeoutCreator, clearFunc: () => void) => void | (() => void | undefined);
export type TimeoutCreator = (handler: () => unknown, timeout: number) => any;
export type TimeoutId = ReturnType<typeof setTimeout>;
export type TimeoutEffectCallback = (timeoutFunc: TimeoutCreator, clearFunc: () => void) => void | (() => void | undefined);
{
"name": "react-timing-hooks",
"version": "2.2.3",
"version": "3.0.0",
"description": "React hooks for setTimeout, setInterval, requestAnimationFrame, requestIdleCallback",

@@ -37,3 +37,5 @@ "main": "dist/index.js",

"requestAnimationFrame",
"requestIdleCallback"
"requestIdleCallback",
"clock",
"timer"
],

@@ -47,29 +49,30 @@ "author": "Eric Lambrecht",

"devDependencies": {
"@shopify/jest-dom-mocks": "^3.0.13",
"@testing-library/react": "^12.1.3",
"@testing-library/react-hooks": "^4.0.1",
"@testing-library/user-event": "^14.0.0-beta",
"@types/jest": "^26.0.14",
"@types/node": "^13.13.21",
"@types/react": "^17.0.38",
"@types/react-dom": "^17.0.11",
"@shopify/jest-dom-mocks": "^4.0.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.3.0",
"@types/jest": "^29.2.4",
"@types/node": "^14.18.34",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"cli-confirm": "^1.0.1",
"commitizen": "^4.2.1",
"emoji-cz": "^0.3.1",
"jest": "^27.5.1",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"node-fetch": "^2.6.7",
"prettier": "^2.1.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-test-renderer": "^17.0.2",
"replace": "^1.2.0",
"polyfill-object.fromentries": "^1.0.1",
"prettier": "^2.5.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-test-renderer": "^18.2.0",
"replace": "^1.2.1",
"rimraf": "^3.0.2",
"rollup": "^2.28.2",
"rollup-plugin-typescript2": "^0.27.2",
"rollup": "^2.67.3",
"rollup-plugin-typescript2": "^0.27.3",
"standard-version": "^9.0.0",
"ts-jest": "^27.1.3",
"typescript": "^4.0.3"
"ts-jest": "^29.0.3",
"typescript": "^4.5.5"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
},

@@ -76,0 +79,0 @@ "config": {

@@ -0,0 +0,0 @@ [![npm](https://flat.badgen.net/npm/v/react-timing-hooks)](https://www.npmjs.com/package/react-timing-hooks)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc