Skip to content

Instantly share code, notes, and snippets.

View amsterdamharu's full-sized avatar

Harm Meijer amsterdamharu

  • Amsterdam Netherlands
View GitHub Profile
const state = {
people: {
1: { id: 1, name: 'one' },
2: { id: 2, name: 'two' },
3: { id: 3, name: 'three' },
},
likes: {
1: [2, 3],
2: [1],
3: [1],
const REMOVE = () => REMOVE;
const get = (object, path, defaultValue) => {
const recur = (current, path, defaultValue) => {
if (current === undefined) {
return defaultValue;
}
if (path.length === 0) {
return current;
}
return recur(