Skip to content

show default value of a function param in typedoc #2253

@vikyw89

Description

@vikyw89

Search terms

default value of a nested param, complex param

Question

How can I show default value of a function param nested object ?

Here's my code

/**
 * A custom hook for managing asynchronous data in an external store with synchronous state.
 *
 * @param selector - The selector for the asynchronous data.
 * @param config - Optional configuration options.
 */
export const useAsyncV = (
  selector: string,
  config: { initialState: { data: any; loading: boolean; error: boolean } } = {
    initialState: { data: null, loading: false, error: false },
  }
) => {
  // Get initial state from config
  const initialState = config.initialState;

  update(store, selector, (p: any) => {
    if (typeof p === "object") {
      if ("data" in p && "loading" in p && "error" in p) return p;
      return { ...p, ...initialState };
    }
    return initialState;
  });

  // Get the synchronous state object for the given selector
  const state = useSyncV(selector);

  // Return the synchronous state object
  return state;
};

image

I want theresulting html to show my default param value

{
    initialState: { data: null, loading: false, error: false }
}

Is there any way I can do that ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestion about functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions