-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Hi
Nice project. Love the modular architecture. 👍
One thing i was missing was an configurable timeout. Would be nice in production mode to have bigger polling timeout than in development since it get then changed less often. 😉
So in watch.browser.js the hard coded value should be replaced by a variable, maybe a function parameter.
ulog/mods/config/watch.browser.js
Line 18 in 2aa3419
| }, 350) |
Then it could be implemented as a setting parameter:
Lines 28 to 29 in 2aa3419
| var settings = grab(this, 'settings', {}) | |
| name = settings[name] && settings[name].config || name |
BTW: There seems to be a bug 🐛 in the code. The interval get not stopped if someone call ulog.set("log_config", {});
Lines 43 to 44 in 2aa3419
| set: function(name) { | |
| if (name === 'log_config') config.update(this) |
Maybe a destructor callback would do the trick. At the end, watch.browser.js would look something like that:
module.exports = function(ulog, pollingTimeout) {
const intervalId = window.setInterval(watchFnc, pollingTimeout);
return () => {
window.clearInterval(intervalId);
}
}