View machine.js
This file contains 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 searchMachine = Machine({ | |
id: 'search', | |
initial: 'idle', | |
context: { | |
results: [], | |
errorMessage: null, | |
}, | |
states: { | |
idle: { | |
on: { FETCH: 'loading' }, |
View gitconfig
This file contains 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
[alias] | |
## | |
# One letter alias for our most frequent commands. | |
# | |
# Guidelines: these aliases do not use options, because we want | |
# these aliases to be easy to compose and use in many ways. | |
## | |
a = add |
View timeit
This file contains 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 tsA = [[1, 'a'], [3, 'c'], [4, 'c'], [8, 'b'], [9, 'a']] | |
const tsB = [[1, 'c'], [2, 'b'], [3, 'c'], [4, 'a'], [5, 'b'], [7, 'a'], [9, 'a']] | |
function getNext(A, B) { | |
let smallestA = A[0]; | |
let smallestB = B[0]; | |
if (!smallestB && smallestA) { | |
return A.shift() | |
} |