RocketChat/Rocket.Chat

View on GitHub
apps/meteor/client/hooks/useAsyncState.ts

Summary

Maintainability
A
1 hr
Test Coverage

Function useAsyncState has 41 lines of code (exceeds 25 allowed). Consider refactoring.
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>();
Severity: Minor
Found in apps/meteor/client/hooks/useAsyncState.ts - About 1 hr to fix

    There are no issues that match your filters.

    Category
    Status