react + redux + RR
It uses https://gist.github.com/iNikNik/3c1b870f63dc0de67c38 for stores and actions.
1) create redux
const redux = createRedux(state);
2) get requireAccess func => bindCheckAuth to redux
function queue(concurrency = 1) { | |
let running = 0 | |
const taskQueue = [] | |
const runTask = (task) => { | |
running++ | |
task(() => { | |
running-- | |
if (taskQueue.length > 0) { | |
runTask(taskQueue.shift()) |
function debounce(func, wait) { | |
let timeout | |
return function(...args) { | |
const context = this | |
clearTimeout(timeout) | |
timeout = setTimeout(() => func.apply(context, args), wait) | |
} | |
} | |
function sayHello() { |
0x4d9f3f6648b51d4D88ecb037aFAc9839347e1A4C |
const mapDispatchToProps = dispatch => ({ | |
toggleOpen: () => dispatch({ | |
type: 'TOGGLE_TRUE', | |
meta: { | |
component: 'ThisComponent', | |
}, | |
}), | |
toggleClosed: dispatch({ | |
type: 'TOGGLE_FALSE', | |
meta: { |
const removeCreativeEpic = (action$) => | |
action$.ofType('REMOVE_CREATIVE') | |
.groupBy(action => action.payload.campaignId) | |
.mergeMap( | |
groupedAction$ => groupedAction$ | |
.concatMap(action => makeAjax(action) | |
.map(response => ({ | |
type: 'REMOVE_CREATIVE_SUCCESS', | |
payload: response, | |
}) |
react + redux + RR
It uses https://gist.github.com/iNikNik/3c1b870f63dc0de67c38 for stores and actions.
1) create redux
const redux = createRedux(state);
2) get requireAccess func => bindCheckAuth to redux
function rob(root) { | |
const memo = new Map() | |
function rob_helper(node) { | |
if (node === null) return 0 | |
if (memo.get(node)) { | |
return memo.get(node) | |
} | |
let keep = node.val |
function sayHello(x) { | |
console.log(x) | |
} | |
const debouncedSayHello = debounce(sayHello, 100) | |
debouncedSayHello(1) | |
debouncedSayHello(2) | |
debouncedSayHello(3) | |
setTimeout(() => debouncedSayHello(4), 200) |
function isChar(key) { | |
return characters.includes(key); | |
} | |
function isSpace(key) { | |
return key === 'space' | |
} | |
const keyup$ = Observable.fromEvent(promptInput, 'keyup') | |
.map(keycode) |
function getCharInRange(first, last) { | |
const charactersInRange = R.compose(R.map(keycode), R.range) | |
return charactersInRange(first, last) | |
} | |
const keystroke$ = getCharInRange(65, 91).reduce((acc$, char) => | |
acc$.merge(Observable.zip( | |
DOM | |
.select(':root') | |
.events('keydown') |