This file contains hidden or 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
class Node extends Component { | |
componentDidMount() { | |
this.queueUpdate() | |
} | |
componentDidUpdate() { | |
this.queueUpdate() | |
} | |
queueUpdate = () => { |
This file contains hidden or 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 render$ = new Subject() | |
const nodesEpic = ( | |
action$, | |
state$, | |
) => ( | |
action$ | |
.pipe( | |
ofType(START_PROCESSING), | |
delay(0), |
This file contains hidden or 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
tempQueue | |
.forEach(( | |
handler, | |
) => { | |
handler() | |
}) |
This file contains hidden or 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
store | |
.queue | |
.push( | |
this | |
.updateState | |
) |
This file contains hidden or 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
class Node extends Component { | |
constructor(props) { | |
super(props) | |
const { | |
initialColor, | |
initialValue, | |
} = props | |
this |
This file contains hidden or 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
class Node extends Component { | |
componentDidMount() { | |
this.queueUpdate() | |
} | |
componentDidUpdate() { | |
this.queueUpdate() | |
} | |
queueUpdate = () => { |
This file contains hidden or 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 queue1 = [] | |
const queue2 = [] | |
let timeoutIds = {} | |
let queue = queue1 | |
const clearQueue = ( | |
queue, | |
) => { | |
queue |
This file contains hidden or 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 node = ( | |
document | |
.getElementById(`node-${id}`) | |
) | |
node.innerHTML = getRandomValue() | |
node.style.color = getRandomColor() |
This file contains hidden or 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
// [Action] ADD_TO_QUEUE | |
// [Action] ADD_TO_QUEUE | |
// [Action] ADD_TO_QUEUE | |
// [Action] START_PROCESSING_QUEUE | |
// Processing value: A | |
// [Action] REMOVE_FROM_QUEUE | |
// 'A' is done | |
// [Action] FINISHED_PROCESSING_ITEM | |
// Processing value: B | |
// [Action] REMOVE_FROM_QUEUE |
This file contains hidden or 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 { delay, filter, map, mapTo, mergeAll, mergeMap, scan, switchMap, tap } = require('rxjs/operators') | |
const { of, Subject } = require('rxjs') | |
const { ofType } = require('redux-observable') | |
const ADD_TO_QUEUE = 'ADD_TO_QUEUE' | |
const FINISHED_PROCESSING_ITEM = 'FINISHED_PROCESSING_ITEM' | |
const REMOVE_FROM_QUEUE = 'REMOVE_FROM_QUEUE' | |
const START_PROCESSING_QUEUE = 'START_PROCESSING_QUEUE' | |
const queueReducer = ( |