UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

19 lines (18 loc) 440 B
import { useState as a } from "react"; const m = (n) => { const [s, i] = a(n); return { list: s, handleListChange: (e) => (t) => { const o = [...s]; o[e] = t, i(o); }, handleListRemove: (e) => () => { const t = s.filter((o, d) => e !== d); i(t); }, appendToList: (...e) => { const t = [...s]; t.push(...e), i(t); }, setList: i }; }; export { m as useListState }; //# sourceMappingURL=useListState.js.map