mirror of
https://github.com/streamich/react-use.git
synced 2025-12-08 18:02:14 +00:00
docs: add useUpsert to readme
This commit is contained in:
parent
4f48494126
commit
03ccfa9845
@ -131,7 +131,7 @@
|
||||
- [`useStateList`](./docs/useStateList.md) — circularly iterates over an array. [![][img-demo]](https://codesandbox.io/s/bold-dewdney-pjzkd)
|
||||
- [`useToggle` and `useBoolean`](./docs/useToggle.md) — tracks state of a boolean. [![][img-demo]](https://codesandbox.io/s/focused-sammet-brw2d)
|
||||
- [`useCounter` and `useNumber`](./docs/useCounter.md) — tracks state of a number. [![][img-demo]](https://streamich.github.io/react-use/?path=/story/state-usecounter--demo)
|
||||
- [`useList`](./docs/useList.md) — tracks state of an array. [![][img-demo]](https://codesandbox.io/s/wonderful-mahavira-1sm0w)
|
||||
- [`useList`](./docs/useList.md) and [`useUpsert`](./docs/useUpsert.md) — tracks state of an array. [![][img-demo]](https://codesandbox.io/s/wonderful-mahavira-1sm0w)
|
||||
- [`useMap`](./docs/useMap.md) — tracks state of an object. [![][img-demo]](https://codesandbox.io/s/quirky-dewdney-gi161)
|
||||
|
||||
|
||||
|
||||
@ -25,3 +25,7 @@ const Demo = () => {
|
||||
);
|
||||
};
|
||||
```
|
||||
|
||||
## Related hooks
|
||||
|
||||
- [useUpsert](./useUpsert.md)
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
# `useUpsert`
|
||||
|
||||
Superset of `useList`. Provides an additional method to upsert (update or insert) an element into the list.
|
||||
Superset of [`useList`](./useList.md). Provides an additional method to upsert (update or insert) an element into the list.
|
||||
|
||||
## Usage
|
||||
|
||||
```jsx
|
||||
@ -26,3 +27,7 @@ const Demo = () => {
|
||||
);
|
||||
};
|
||||
```
|
||||
|
||||
## Related hooks
|
||||
|
||||
- [useList](./useList.md)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user