Deletable nodes (#801)

Co-authored-by: Muhammed Salih Altun <muhammedsalihaltun@gmail.com>
This commit is contained in:
Kerem Yilmaz
2024-09-10 07:07:56 -07:00
committed by GitHub
parent b12f09c535
commit 0053736f8f
15 changed files with 423 additions and 190 deletions

View File

@@ -0,0 +1,16 @@
import { DeleteNodeCallbackContext } from "@/store/DeleteNodeCallbackContext";
import { useContext } from "react";
function useDeleteNodeCallback() {
const deleteNodeCallback = useContext(DeleteNodeCallbackContext);
if (!deleteNodeCallback) {
throw new Error(
"useDeleteNodeCallback must be used within a DeleteNodeCallbackProvider",
);
}
return deleteNodeCallback;
}
export { useDeleteNodeCallback };