Skip to main content

useBackend

Home > @anocca/sequence-viewer-backend-react-state > useBackend

Creates an annotation backend that stores annotations in React.setState.

See: Annotation

Signature:

useBackend: (initialAnnotations?: Annotation[]) => {
annotations: Annotation[];
getAnnotationLabelById: (id: string) => string;
getAnnotationById: (id: string) => Annotation;
addAnnotation: (annotation: Annotation) => void;
deleteAnnotations: (ids: string[]) => void;
showAnnotations: (ids: string[]) => void;
hideAnnotations: (ids: string[]) => void;
updateAnnotation: (annotation: Annotation) => void;
}