UNPKG

@progress/kendo-react-common

Version:

React Common package delivers common utilities that can be used with the KendoReact UI components. KendoReact Common Utilities package

30 lines (29 loc) 892 B
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use client"; import * as c from "react"; var s = /* @__PURE__ */ ((e) => (e[e.add = 0] = "add", e[e.remove = 1] = "remove", e))(s || {}); const a = (e = []) => { const r = c.useRef(e), n = c.useCallback((t) => { switch (t.type) { case 0: r.current.push(t.item); break; case 1: { const o = r.current.indexOf(t.item); r.current.splice(o, 1); break; } } }, []); return [r.current, n]; }; export { s as COLLECTION_ACTION, a as useCollection };