Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename the AnnotoriousPlugin cleanup callback unmount -> destroy #377

Open
oleksandr-danylchenko opened this issue Feb 26, 2024 · 0 comments

Comments

@oleksandr-danylchenko
Copy link
Contributor

oleksandr-danylchenko commented Feb 26, 2024

Current State

Currently, the AnnotoriousPluginProps receives the plugin function argument that returns the { unmount: ... } object:

export interface AnnotoriousPluginProps <I extends Annotation, E extends unknown> {
plugin: (anno: Annotator<I, E>, opts?: Object) => ({ unmount?: () => void }) | void;
opts?: Object;
}

Issue

Could we rename the unmount to destroy? Seems like it's a more popular name for the cleanup within the library and is used for most of the modules:

const destroy = () => {
// Destroy Svelte annotation layer
annotationLayer.$destroy();
// Unwrap the image
container.parentNode!.insertBefore(img, container);
container.parentNode!.removeChild(container);
// Other cleanup actions
keyboardCommands.destroy();
undoStack.destroy();
}

@oleksandr-danylchenko oleksandr-danylchenko changed the title Rename the unmount -> destroy in the Plugin cleanup callback Rename the AnnotoriousPlugin cleanup callback unmount -> destroy Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant