This file contains 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
// index.js | |
ReactDOM.render(<App /> , document.getElementById('root')) | |
if (module.hot) { | |
module.hot.accept('./App', () => { | |
ReactDOM.render(<App />, document.getElementById('root')) | |
}) | |
} | |
// store.js |
This file contains 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
// Small version | |
var provinces = [ | |
{plain:"Alberta",name:"Alberta",abbr:"AB"}, | |
{plain:"British Columbia",name:"British Columbia",abbr:"BC"}, | |
{plain:"Manitoba",name:"Manitoba",abbr:"MB"}, | |
{plain:"New Brunswick",name:"New Brunswick",abbr:"NB"}, | |
{plain:"Newfoundland & Labrador",name:"Newfoundland & Labrador",abbr:"NL"}, | |
{plain:"Northwest Territories",name:"Northwest Territories",abbr:"NT"}, | |
{plain:"Nova Scotia",name:"Nova Scotia",abbr:"NS"}, | |
{plain:"Nunavut",name:"Nunavut",abbr:"NU"}, |
This file contains 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
/** | |
* Clamps a number. Based on Zevan's idea: http://actionsnippet.com/?p=475 | |
* params: val, min, max | |
* Author: Jakub Korzeniowski | |
* Agency: Softhis | |
* http://www.softhis.com | |
*/ | |
(function(){Math.clamp=function(a,b,c){return Math.max(b,Math.min(c,a));}})(); |