jacomyal / domino.js

[deprecated] A JavaScript cascading controller for fast interactive Web interfaces prototyping.
https://jacomyal.github.io/domino.js
MIT License
54 stars 7 forks source link

[reboot-proposal] Use #go to skip the setTimeout in #addOrder #61

Open jacomyal opened 9 years ago

jacomyal commented 9 years ago

Here is the problem to solve: If in a React component with a domino mixin, you write something like :

this.control.update('myProperty', myValue);
this.control.emit('myEvent');
// Or maybe more something like:
this.control
  .update('myProperty', myValue)
  .emit('myEvent');

...domino will use a setTimeout(fn, 0) to execute orders in a lazy way. But it will often cause some UX problems to have rendering frames appearing between the user input and the next actual rendering. So, I want to add a domino#go method that will skip that rendering.

So, the previous code would look like that:

this.control
  .update('myProperty', myValue)
  .emit('myEvent')
  .go();