Should I call screen.render() each time a style is changed?

108
May 29, 2019, at 7:50 PM

I'm using https://github.com/chjj/blessed and have the following code:

navList.on('focus', function() {
  navList.style.border.fg = 'green'; 
  screen.render(); 
});
navList.on('blur', function() {
  navList.style.border.fg = 'white'; 
  screen.render(); 
});
detailBox.on('focus', function() {
  detailBox.style.border.fg = 'green'; 
  screen.render(); 
});
detailBox.on('blur', function() { 
  detailBox.style.border.fg = 'white'; 
  screen.render(); 
});

Before I added the screen.render() the border colour-change would not show until the next repaint, which generally happens when the user presses a key or clicks elsewhere.

The code works, but is screen.render() the best way to show the border colour-change?

READ ALSO
mongodb group values by multiple fields

mongodb group values by multiple fields

For example, I have these documents:

87
why is nvm (for windows) not working and whenever it runs it gives an error message?

why is nvm (for windows) not working and whenever it runs it gives an error message?

nvm (for windows https://githubcom/coreybutler/nvm-windows)

108
MongoDB findOneAndUpdate returns null

MongoDB findOneAndUpdate returns null

I have this and I cannot get it to workConsole

115
How to fix the “undefined” return from my mongoose/mongodb search function

How to fix the “undefined” return from my mongoose/mongodb search function

I'm attempting to get the result from mongodb and then pass it to a const, but getting return vale of "undfined" where did I go wrong?

105