Conform more code to strict null checking (#10169)
* Conform more code to strict null checking * delint * Iterate * delint * Fix bad test
This commit is contained in:
parent
5123d7e641
commit
e8b92b308b
85 changed files with 283 additions and 287 deletions
|
@ -18,7 +18,9 @@ import { useState, useEffect, DependencyList } from "react";
|
|||
|
||||
type Fn<T> = () => Promise<T>;
|
||||
|
||||
export const useAsyncMemo = <T>(fn: Fn<T>, deps: DependencyList, initialValue?: T): T | undefined => {
|
||||
export function useAsyncMemo<T>(fn: Fn<T>, deps: DependencyList, initialValue: T): T;
|
||||
export function useAsyncMemo<T>(fn: Fn<T>, deps: DependencyList, initialValue?: T): T | undefined;
|
||||
export function useAsyncMemo<T>(fn: Fn<T>, deps: DependencyList, initialValue?: T): T | undefined {
|
||||
const [value, setValue] = useState<T | undefined>(initialValue);
|
||||
useEffect(() => {
|
||||
let discard = false;
|
||||
|
@ -32,4 +34,4 @@ export const useAsyncMemo = <T>(fn: Fn<T>, deps: DependencyList, initialValue?:
|
|||
};
|
||||
}, deps); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
return value;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ interface UserOnboardingTask {
|
|||
relevant?: UseCase[];
|
||||
action?: {
|
||||
label: string;
|
||||
onClick?: (ev?: ButtonEvent) => void;
|
||||
onClick?: (ev: ButtonEvent) => void;
|
||||
href?: string;
|
||||
hideOnComplete?: boolean;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue