Deletable nodes (#801)
Co-authored-by: Muhammed Salih Altun <muhammedsalihaltun@gmail.com>
This commit is contained in:
@@ -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 };
|
||||
Reference in New Issue
Block a user