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

Proper way to destroy? #288

Open
Spown opened this issue Dec 12, 2016 · 0 comments
Open

Proper way to destroy? #288

Spown opened this issue Dec 12, 2016 · 0 comments

Comments

@Spown
Copy link

Spown commented Dec 12, 2016

Or at least to stop watching the locales dir? Calling .configure on the i18n instance once more with autoReload: false doesn't do anything. No wonder. After watching is started it just stays.

In my case I write unit tests for my platform, which utilizes i18n and sets autoReload to (NODE_ENV ==="development"). So when I run the tests it works fine, but when I develop them... After tests are done I do an automatic cleanup, which means the locales dir needs to be purged. But instead I get an exception. Because the dir continues to being watched even after I seemingly destroy my platform.

Please introduce a destructor, that unwatches the dir and/or let watching/unwatching procedure run on every .configure call.

Thanks

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