Code Monkey home page Code Monkey logo

Comments (3)

changeelog avatar changeelog commented on August 12, 2024

Hooks

/**
 * Brief description of the hook.
 *
 * A more detailed description of the hook, if necessary. Can include
 * information about when to use the hook, how it works internally,
 * or potential edge cases.
 *
 * @param {Type} name - Description of the parameter. Be specific about
 * the expected type and any constraints. If a parameter is optional,
 * indicate it using `?` after the parameter name.
 * @returns {Type} Description of the return value. Be specific about
 * the type and structure of the returned value.
 *
 * @example
 * // Example usage of the hook with explanation
 * const exampleExample = useHook(parameters);
 */
export const useHook = (parameter: Type): ReturnType => {
  // ... implementation
};

Utilities

/**
 * Brief description of the utility function.
 *
 * A more detailed description of the utility function, if necessary.
 * Can include information about when to use the function, how it works
 * internally, or potential edge cases.
 *
 * @param {Type1} parameter1 - Description of the first parameter.
 * @param {Type2} [parameter2] - Description of the second optional parameter.
 * @returns {ReturnType} Description of the return value.
 *
 * @example
 * // Example usage of the utility function
 * const result = utilityFunction(parameter1, parameter2);
 */
export const utilityFunction = (parameter1: Type1, parameter2?: Type2): ReturnType => {
  // ... implementation
};

Types

/**
 * Type description. Provide a clear and concise explanation of what
 * the type represents and how it should be used.
 *
 * @typedef {Object} TypeName
 * @property {Type} propertyName - Property description. Be specific
 * about the expected type and any constraints. Indicate optional
 * properties using `?` after the property name.
 */
export type TypeName = {
  propertyName: Type;
};

Enums

/**
 * Enum description. Explain the purpose of the enum and the meaning
 * of each value.
 *
 * @enum {string} EnumName
 */
export enum EnumName {
  /** Description of value 1. */
  VALUE1 = 'value1',
  /** Description of value 2. */
  VALUE2 = 'value2',
}

Interfaces

/**
 * Interface description. Provide a clear and concise explanation of
 * what the interface represents and how it should be used.
 *
 * @interface InterfaceName
 */
export interface InterfaceName {
  /** Description of property 1. */
  property1: Type;
  /** Description of property 2. (Optional) */
  property2?: Type;
}

Constants

/**
 * Constant description. Explain the purpose and usage of the constant.
 *
 * @type {Type}
 */
export const CONSTANT_NAME: Type = value;

from reactuse.

changeelog avatar changeelog commented on August 12, 2024

Updated the documentation pattern for hooks
UPD: Updated the documentation pattern for types? enums, interfaces, constants.
UPD: Added Utilities documentation pattern.

from reactuse.

changeelog avatar changeelog commented on August 12, 2024

I think I've covered most of the cases in this issues and there will be no problems with it in the future. There is no need for this issue anymore.

from reactuse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.