Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. import VanillaCounterCollarView from './vanilla/Counter';
  2.  
  3. const counterCollarView = VanillaCounterCollarView('#vanilla-counter-collar', 'vanilla-counter-collar');
  4.  
  5. // register action handler
  6. counterCollarView.addActionHandler('INCREMENT', () => {
  7. state.count++;
  8. counterCollarView.update(state);
  9. });
  10. counterCollarView.addActionHandler('DECREMENT', () => {
  11. state.count--;
  12. counterCollarView.update(state);
  13. });
  14.  
  15. // finally, render the view
  16. counterCollarView.render(state);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement