Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create your store passing it your reducer
- const store = Redux.createStore(counter);
- // Set value element to the current state (count)
- const render = () => {
- document.getElementById('value').innerHTML = store.getState().toString();
- }
- render();
- // Subscribe our render method to the store so it executes when a value is changed
- store.subscribe(render);
Add Comment
Please, Sign In to add comment