linting fixes
This commit is contained in:
parent
5591b0e683
commit
85547116f9
@ -176,10 +176,10 @@ export class AutoVerifier<T> {
|
|||||||
this.trustedStatus = 'none';
|
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?
|
// 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
|
// this would likely make it possible to get rid of the "else" block in tryResolveTrustedPromise
|
||||||
// Make sure it would work properly for retry functionality
|
// make sure it would work properly for retry functionality
|
||||||
// can't because of primary promise early resolution
|
// can't because of primary promise early resolution
|
||||||
|
|
||||||
// fetches the result of the primary fetchable
|
// fetches the result of the primary fetchable
|
||||||
@ -311,7 +311,7 @@ export class AutoVerifier<T> {
|
|||||||
} else {
|
} else {
|
||||||
console.warn('trusted promise from another path rejected after unverify', e);
|
console.warn('trusted promise from another path rejected after unverify', e);
|
||||||
// TODO: only retry if there is another trusted promise available...
|
// TODO: only retry if there is another trusted promise available...
|
||||||
// OR always reject?
|
// or maybe always reject?
|
||||||
await tryResolveTrustedPromise();
|
await tryResolveTrustedPromise();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -398,16 +398,13 @@ export function guildDataSubscriptionLoadableMultipleEffect<
|
|||||||
const effect: AtomEffect<LoadableValue<T[]>> = atomEffectParam => {
|
const effect: AtomEffect<LoadableValue<T[]>> = atomEffectParam => {
|
||||||
const { trigger } = atomEffectParam;
|
const { trigger } = atomEffectParam;
|
||||||
|
|
||||||
/* LOG.debug(`multiple effect for guild #${guildId}`); */
|
|
||||||
const fetchValueFunc = createFetchValueFunc(atomEffectParam, guildId, fetchFunc);
|
const fetchValueFunc = createFetchValueFunc(atomEffectParam, guildId, fetchFunc);
|
||||||
|
|
||||||
// fetch initial value on first get
|
// fetch initial value on first get
|
||||||
if (trigger === 'get') {
|
if (trigger === 'get') {
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
/* LOG.debug('awaiting fetchValueFunc Multiple'); */
|
|
||||||
await fetchValueFunc();
|
await fetchValueFunc();
|
||||||
/* LOG.debug('done fetchValueFunc Multiple'); */
|
|
||||||
} catch (e: unknown) {
|
} catch (e: unknown) {
|
||||||
LOG.error('error fetching initial value', e);
|
LOG.error('error fetching initial value', e);
|
||||||
}
|
}
|
||||||
|
@ -60,14 +60,11 @@ window.addEventListener('DOMContentLoaded', () => {
|
|||||||
|
|
||||||
LOG.silly('guildsManager initialized');
|
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')!);
|
const root = createRoot(document.getElementById('react-root')!);
|
||||||
function initializeState({ set }: MutableSnapshot): void {
|
|
||||||
set(guildsManagerState, guildsManager);
|
|
||||||
}
|
|
||||||
root.render(
|
root.render(
|
||||||
<RecoilRoot initializeState={initializeState}>
|
<RecoilRoot initializeState={({ set }: MutableSnapshot): void => {
|
||||||
|
set(guildsManagerState, guildsManager);
|
||||||
|
}}>
|
||||||
<RootElement />
|
<RootElement />
|
||||||
</RecoilRoot>,
|
</RecoilRoot>,
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user