Created
August 5, 2018 14:42
-
-
Save tiagolpadua/725ab816dcb2e8c80d22a84d60702642 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Um contador</title> | |
<script src="https://unpkg.com/redux@latest/dist/redux.min.js"></script> | |
</head> | |
<body> | |
<div> | |
<p> | |
Clicou: | |
<span id="value">0</span> vezes | |
<button id="increment">+</button> | |
<button id="decrement">-</button> | |
<button id="incrementIfOdd">Incrementa se for ímpar</button> | |
<button id="incrementAsync">Incrementa assíncrono</button> | |
</p> | |
</div> | |
<script> | |
var valueEl = document.getElementById('value'); | |
//TODO counter | |
function render() { | |
//TODO | |
} | |
//TODO createStore | |
render() | |
document.getElementById('increment') | |
.addEventListener('click', function () { | |
//TODO | |
}); | |
document.getElementById('decrement') | |
.addEventListener('click', function () { | |
//TODO | |
}); | |
document.getElementById('incrementIfOdd') | |
.addEventListener('click', function () { | |
//TODO | |
}); | |
document.getElementById('incrementAsync') | |
.addEventListener('click', function () { | |
setTimeout(function () { | |
//TODO | |
}, 1000) | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment