linting fixes

This commit is contained in:
Michael Peters 2022-10-23 14:18:36 -07:00
parent 5591b0e683
commit 85547116f9
3 changed files with 7 additions and 13 deletions

View File

@ -176,10 +176,10 @@ export class AutoVerifier<T> {
this.trustedStatus = 'none';
}
// To consider: It may be possible to reduce the complexity of this function a bit.
// to consider: It may be possible to reduce the complexity of this function a bit.
// TODO: Why not have fetcher and a simple dedup wrapper to remove some of the complexity from this function?
// This would likely make it possible to get rid of the "else" block in tryResolveTrustedPromise
// Make sure it would work properly for retry functionality
// this would likely make it possible to get rid of the "else" block in tryResolveTrustedPromise
// make sure it would work properly for retry functionality
// can't because of primary promise early resolution
// fetches the result of the primary fetchable
@ -311,7 +311,7 @@ export class AutoVerifier<T> {
} else {
console.warn('trusted promise from another path rejected after unverify', e);
// TODO: only retry if there is another trusted promise available...
// OR always reject?
// or maybe always reject?
await tryResolveTrustedPromise();
return;
}

View File

@ -398,16 +398,13 @@ export function guildDataSubscriptionLoadableMultipleEffect<
const effect: AtomEffect<LoadableValue<T[]>> = atomEffectParam => {
const { trigger } = atomEffectParam;
/* LOG.debug(`multiple effect for guild #${guildId}`); */
const fetchValueFunc = createFetchValueFunc(atomEffectParam, guildId, fetchFunc);
// fetch initial value on first get
if (trigger === 'get') {
(async () => {
try {
/* LOG.debug('awaiting fetchValueFunc Multiple'); */
await fetchValueFunc();
/* LOG.debug('done fetchValueFunc Multiple'); */
} catch (e: unknown) {
LOG.error('error fetching initial value', e);
}

View File

@ -60,14 +60,11 @@ window.addEventListener('DOMContentLoaded', () => {
LOG.silly('guildsManager initialized');
// TODO: Try using initializeState from recoilRoot
// https://recoiljs.org/docs/api-reference/core/RecoilRoot/
const root = createRoot(document.getElementById('react-root')!);
function initializeState({ set }: MutableSnapshot): void {
set(guildsManagerState, guildsManager);
}
root.render(
<RecoilRoot initializeState={initializeState}>
<RecoilRoot initializeState={({ set }: MutableSnapshot): void => {
set(guildsManagerState, guildsManager);
}}>
<RootElement />
</RecoilRoot>,
);