Move left pane entirely to React

This commit is contained in:
Scott Nonnenberg 2019-01-14 13:49:58 -08:00
parent bf904ddd12
commit b3ac1373fa
142 changed files with 5016 additions and 3428 deletions

12
ts/util/makeLookup.ts Normal file
View file

@ -0,0 +1,12 @@
import { fromPairs, map } from 'lodash';
export function makeLookup<T>(
items: Array<T>,
key: string
): { [key: string]: T } {
// Yep, we can't index into item without knowing what it is. True. But we want to.
// @ts-ignore
const pairs = map(items, item => [item[key], item]);
return fromPairs(pairs);
}