on master help sign in
devex: improve pointcache race condition fix
73d2203tomholford
src/store/pointCache.jsx+8−6
@@ -1,6 +1,7 @@
1import { Just, Nothing } from 'folktale/maybe';
1import { Just, Nothing } from 'folktale/maybe';
2import Result from 'folktale/result';
2import Result from 'folktale/result';
3import React, { createContext, forwardRef, useContext } from 'react';
3import React, { createContext, forwardRef, useContext } from 'react';
4+import { noop } from 'lodash';
4
5
5import useDeepEqualReference from 'lib/useDeepEqualReference';
6import useDeepEqualReference from 'lib/useDeepEqualReference';
6import usePointStore from './lib/usePointStore';
7import usePointStore from './lib/usePointStore';
@@ -17,12 +18,13 @@ const initialContext = {
17 controlledPoints: Just(Result.Error('not yet loaded')),
18 controlledPoints: Just(Result.Error('not yet loaded')),
18 ecliptic: Nothing(),
19 ecliptic: Nothing(),
19 residents: Nothing(),
20 residents: Nothing(),
20− syncDetails: () => [],
21+ syncDetails: noop,
22+ syncEclipticOwner:noop,
21− syncRekeyDate: () => [],
23+ syncRekeyDate: noop,
22− syncControlledPoints: () => [],
24+ syncControlledPoints: noop,
23− syncDates: () => [],
25+ syncDates: noop,
24− syncResidents: () => [],
26+ syncResidents: noop,
25− syncExtras: () => [],
27+ syncExtras: noop,
26}
28}
27
29
28export const PointCacheContext = createContext(initialContext);
30export const PointCacheContext = createContext(initialContext);