Sha256: 590e89377462a8245a3bf287938b786ed54f580d2c79a23d970f12a4747eccd3
Contents?: true
Size: 613 Bytes
Versions: 3
Compression:
Stored size: 613 Bytes
Contents
import { useState } from "react"; import { useDragCollection } from "../drag"; import * as Attachments from "../../types/Attachments"; export default function useAttachments( records: Attachments.Record[] ): Attachments.State { const [deleted, setDeleted] = useState<Attachments.Record[]>([]); const collection = useDragCollection(records); const update = (records: Attachments.Record[]) => { collection.dispatch({ type: "reinitialize", payload: records }); setDeleted([]); }; return { collection: collection, deleted: deleted, setDeleted: setDeleted, update: update }; }
Version data entries
3 entries across 3 versions & 1 rubygems