apps/meteor/client/hooks/useAsyncState.ts
Function useAsyncState
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useAsyncState = <T>(initialValue?: T | (() => T)): AsyncStateObject<T> => {
const [state, setState] = useSafely(
useState<AsyncState<T>>(() => {
if (typeof initialValue === 'undefined') {
return asyncState.loading<T>();