source: imaps-frontend/node_modules/react-use/esm/useUpsert.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 502 bytes
Line 
1import { __assign } from "tslib";
2import useList from './useList';
3/**
4 * @deprecated Use `useList` hook's upsert action instead
5 */
6export default function useUpsert(predicate, initialList) {
7 if (initialList === void 0) { initialList = []; }
8 var _a = useList(initialList), list = _a[0], listActions = _a[1];
9 return [
10 list,
11 __assign(__assign({}, listActions), { upsert: function (newItem) {
12 listActions.upsert(predicate, newItem);
13 } }),
14 ];
15}
Note: See TracBrowser for help on using the repository browser.