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

@shopify/react-hooks

Package Overview
Dependencies
Maintainers
13
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/react-hooks - npm Package Compare versions

Comparing version 1.6.0 to 1.6.1

6

CHANGELOG.md

@@ -10,2 +10,8 @@ # Changelog

## [1.6.1] - 2020-04-07
### Fixed
- `useOnChangeValue` is now executed in an `useEffect` and doesn't block the render method anymore. **This fix may cause timing issue in your project if you depended on the change handler happening synchronously.**
## [1.6.0] - 2020-03-02

@@ -12,0 +18,0 @@

14

dist/src/hooks/on-value-change.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var react_1 = tslib_1.__importDefault(require("react"));
var react_1 = tslib_1.__importStar(require("react"));
function useOnValueChange(value, onChange) {
var tracked = react_1.default.useRef(value);
var oldValue = tracked.current;
if (value !== oldValue) {
tracked.current = value;
onChange(value, oldValue);
}
react_1.useEffect(function () {
var oldValue = tracked.current;
if (value !== tracked.current) {
tracked.current = value;
onChange(value, oldValue);
}
}, [value, onChange]);
}
exports.useOnValueChange = useOnValueChange;
{
"name": "@shopify/react-hooks",
"version": "1.6.0",
"version": "1.6.1",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "A collection of primitive React 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