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

Export cleanup function from register entry-point #239

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

perrin4869
Copy link

I thought that this could be useful in a few cases, but please ignore this if you feel it's not worth it.
Could help keep some code a little bit cleaner

@modosc
Copy link
Owner

modosc commented Jun 24, 2022

thanks @perrin4869 - this is a good idea but i'd like to keep things similar to the non-register case, and i'm not clear on the best way forward.

one option might be to explicitly provide a named cleanup export in both cases so one could do:

import globalJsdom, { cleanup } from 'global-jsdom'
import { cleanup } from 'global-jsdom/register'

granted this would be a breaking change but it seems a lot cleaner than the existing implementations. what do you think?

@perrin4869
Copy link
Author

Hm... I don't know, I find it quite natural that the cleanup function would be the default export from global-jsdom/register.
What would be the functionality of the cleanup named export from global-jsdom be?

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

Successfully merging this pull request may close these issues.

2 participants