UNPKG

react-pdf-ner-annotator

Version:

A React component to annotate named entities directly onto a PDF.

21 lines 748 B
"use strict"; exports.__esModule = true; var react_1 = require("react"); var useAnnotationUpdater = function (actionHash, annotations, readonly, updateAnnotationsParent) { var lastResolvedHash = (0, react_1.useRef)(''); (0, react_1.useEffect)(function () { if (readonly) { return; } if (!useAnnotationUpdater) { return; } if (actionHash === lastResolvedHash.current) { return; } lastResolvedHash.current = actionHash; updateAnnotationsParent(annotations); }, [actionHash, readonly, updateAnnotationsParent, annotations]); }; exports["default"] = useAnnotationUpdater; //# sourceMappingURL=useAnnotationUpdater.js.map