New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-use

Package Overview
Dependencies
Maintainers
1
Versions
272
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-use - npm Package Compare versions

Comparing version 5.4.1 to 5.5.0

13

CHANGELOG.md

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

# [5.5.0](https://github.com/streamich/react-use/compare/v5.4.1...v5.5.0) (2019-02-23)
### Bug Fixes
* add type definition for useList() remove() method ([ea2dc43](https://github.com/streamich/react-use/commit/ea2dc43))
* useSetState bug ([83611a1](https://github.com/streamich/react-use/commit/83611a1))
### Features
* Add remove method for useList ([5a295d9](https://github.com/streamich/react-use/commit/5a295d9))
## [5.4.1](https://github.com/streamich/react-use/compare/v5.4.0...v5.4.1) (2019-02-19)

@@ -2,0 +15,0 @@

1

lib/useList.d.ts
export interface Actions<T> {
set: (list: T[]) => void;
updateAt: (index: number, item: T) => void;
remove: (index: number) => void;
push: (item: T) => void;

@@ -5,0 +6,0 @@ filter: (fn: (value: T) => boolean) => void;

@@ -13,2 +13,6 @@ "use strict";

]),
remove: (index) => set([
...list.slice(0, index),
...list.slice(index + 1)
]),
push: (entry) => set([...list, entry]),

@@ -15,0 +19,0 @@ filter: (fn) => set(list.filter(fn)),

5

lib/useSetState.js

@@ -7,6 +7,3 @@ "use strict";

const setState = patch => {
if (patch instanceof Function)
set(prevState => Object.assign({}, prevState, patch(prevState)));
else
set(Object.assign({}, state, patch));
set(prevState => Object.assign({}, prevState, patch instanceof Function ? patch(prevState) : patch));
};

@@ -13,0 +10,0 @@ return [state, setState];

{
"name": "react-use",
"version": "5.4.1",
"version": "5.5.0",
"description": "Collection of React Hooks",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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