Skip to content

Refactor: Take out debouce logic in a separate custom hooks #1363

@shubhdevelop

Description

@shubhdevelop

Issue Description

  • Currently, the debounce slider function in the progressContainer can be taken out in a custom hook. This improves the code reusability and de-attaches the debounce logic from the component's implementation.

Expected Behaviour

There is scope for refactor, which will make code more reusable and maintainable.

Current behaviour

the logic is inside the component's implementation, making the debounce Logic not reusable

Reference

https://github.com/Real-Dev-Squad/website-status/blob/develop/src/components/tasks/card/progressContainer/index.tsx

const debounceSlider = (debounceTimeOut: number) => {
        if (debounceTimeOut) {
            clearTimeout(debounceTimeOut);
        }
        setTimeout(() => {
            onProgressChange();
        }, 1000);
    };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions