Skip to content

Instantly share code, notes, and snippets.

View slugbyte's full-sized avatar
⌨️

Duncan Marsh slugbyte

⌨️
View GitHub Profile
// great for perioticly limiting events
throttle = (fn, ms) => {
let ready = true;
return (...args) => {
if(ready){
ready = false
setTimeout(() => ready = true, ms)
return fn(...args)
}
}
$brand-primary: #fafaf7;
$brand-secondary: #afafaf;
$brand-active: #47a;
$brand-focus: #774;
$brand-error: #f44;
$brand-success: #7f7;
$brand-black: #000;
$brand-dark: #444;
@gonzalovazquez
gonzalovazquez / redux-create-store.js
Created February 1, 2017 15:33
Implementing Redux Store from Scratch
const counter = (state = 0,
action) => {
switch (action.type) {
case 'INCREMENT':
return state + 1;
case 'DECREMENT':
return state - 1;
default:
return state;
}