react-use
Advanced tools
Comparing version 5.2.3 to 5.3.0
@@ -0,1 +1,8 @@ | ||
# [5.3.0](https://github.com/streamich/react-use/compare/v5.2.3...v5.3.0) (2019-02-07) | ||
### Features | ||
* Add updateAt method for useList ([ad05609](https://github.com/streamich/react-use/commit/ad05609)) | ||
## [5.2.3](https://github.com/streamich/react-use/compare/v5.2.2...v5.2.3) (2019-02-07) | ||
@@ -2,0 +9,0 @@ |
export interface Actions<T> { | ||
set: (list: T[]) => void; | ||
updateAt: (index: number, item: T) => void; | ||
push: (item: T) => void; | ||
@@ -4,0 +5,0 @@ filter: (fn: (value: T) => boolean) => void; |
@@ -8,2 +8,7 @@ "use strict"; | ||
set, | ||
updateAt: (index, entry) => set([ | ||
...list.slice(0, index), | ||
entry, | ||
...list.slice(index + 1) | ||
]), | ||
push: (entry) => set([...list, entry]), | ||
@@ -10,0 +15,0 @@ filter: (fn) => set(list.filter(fn)), |
{ | ||
"name": "react-use", | ||
"version": "5.2.3", | ||
"version": "5.3.0", | ||
"description": "Collection of React Hooks", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
87029
1898