-
Notifications
You must be signed in to change notification settings - Fork 934
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
better Browser Support without refresh the page #534
Comments
The reason for this seems to be because it's just coded that way. You can see here that the load() method that reads the local storage only gets called when the debug object is created. We could listen for the storage event to know when to update the state. |
It seems like implementing this would lead to huge breaking changes with the current way debug is coded. To be able to change the namespaces for debug instances live you'd need to somehow expose this method to browser.js. What you could do is listen to the storage event yourself and just recreate your debug instances this way they would re-read the localStorage. |
@mydearxym the localStorage.debug = '';
const debug = require('debug');
const log = debug('MyApplication:log');
log('blah'); // not logged
debug.enable('*');
log('blah'); // logged |
@mydearxym Did @leahciMic and @czaarek99 answer your question? |
@Qix- @leahciMic @czaarek99 sorry for the delay. |
hi there ~
in the doc:
is there a way to not
refresh
the page and make it work ?The text was updated successfully, but these errors were encountered: