1import { useEffect } from 'react';
2import { isEqual } from 'lodash';
4import { usePointCache } from 'store/pointCache';
5import usePreviousValue from 'lib/usePreviousValue';
7// sync a known point to the cache (i.e display values)
8export function useSyncKnownPoints(points = []) {
12// sync an owned point to the cache
13export function useSyncOwnedPoints(points = []) {
14 const { syncOwnedPoint } = usePointCache();
15 const prevPoints = usePreviousValue(points);
18 if (!isEqual(prevPoints, points)) {
19 // if the actual set of points changes, sync the whole array
20 // TODO: we should get clever about caching
21 points.forEach(point => syncOwnedPoint(point));
23 }, [syncOwnedPoint, prevPoints, points]);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list