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
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 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') |
const array = [] | |
array[2] = 2 | |
console.log(array) | |
//[,,2] | |
console.log(array.length) | |
//3 |
const iteratee = (elem, cb) => setTimeout(() => cb(null, elem*2), 100) | |
map([1,2,3], iteratee, (err, result) => { | |
if (err) { | |
console.log(err) | |
} else { | |
console.log(result) | |
} | |
}) | |
// [2, 4, 6] |
function map(collection, iteratee, callback) { | |
let running = collection.length | |
const results = [] | |
collection.forEach((value, index) => | |
iteratee(value, (err, data) => { | |
if (err) { | |
callback(err) | |
return | |
} | |
results[index] = data |