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
const counter = (state = 0, | |
action) => { | |
switch (action.type) { | |
case 'INCREMENT': | |
return state + 1; | |
case 'DECREMENT': | |
return state - 1; | |
default: | |
return state; | |
} |
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
$brand-primary: #fafaf7; | |
$brand-secondary: #afafaf; | |
$brand-active: #47a; | |
$brand-focus: #774; | |
$brand-error: #f44; | |
$brand-success: #7f7; | |
$brand-black: #000; | |
$brand-dark: #444; |
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
// great for perioticly limiting events | |
throttle = (fn, ms) => { | |
let ready = true; | |
return (...args) => { | |
if(ready){ | |
ready = false | |
setTimeout(() => ready = true, ms) | |
return fn(...args) | |
} | |
} |