Skip to content

Instantly share code, notes, and snippets.

View CHR15-'s full-sized avatar

Chris Evans CHR15-

View GitHub Profile
@CHR15-
CHR15- / loop.js
Created January 11, 2020 00:16
Node Event Loop
// node myfile.js
const pendingTimers = [];
const pendingOSTasks = [];
const pendingOperations = [];
// New timers, tasks, ops are recorded from this file running
myFile.runContents();
shouldContinue = () => {
@CHR15-
CHR15- / redux-theory.js
Last active January 11, 2020 00:17
Redux Theory
const reduxFlow = {
1: "A call is made somewhere which dispatches an action",
2: "This action is passed into a reducer",
3: "That reducer then returns some new state",
4: "That state is updated in the store/state tree",
5: "Subscribers are then notified about the new state."
}
// Example store creation
const createStore = (reducer, initState = {}, enhancer) => {