Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import VanillaCounterCollarView from './vanilla/Counter';
- const counterCollarView = VanillaCounterCollarView('#vanilla-counter-collar', 'vanilla-counter-collar');
- // register action handler
- counterCollarView.addActionHandler('INCREMENT', () => {
- state.count++;
- counterCollarView.update(state);
- });
- counterCollarView.addActionHandler('DECREMENT', () => {
- state.count--;
- counterCollarView.update(state);
- });
- // finally, render the view
- counterCollarView.render(state);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement