Skip to content

useInterval: registerInterval passes unused argument to removeInterval #18273

@Kundan-CR7

Description

@Kundan-CR7

What happened?

In ui/src/composables/use-interval/use-interval.js, the registerInterval function calls:

removeInterval(timer)

However, the removeInterval function does not accept any parameters.
The timer argument is unused and has no effect.

This creates confusion for readers and contributors because it suggests that removeInterval expects a parameter when it actually relies on the closure-scoped timer.

What did you expect to happen?

The removeInterval function should be called without arguments.

Expected usage:

removeInterval()

Removing the unnecessary parameter improves code clarity and avoids misleading readers.

Reproduction URL

https://codepen.io/ymorguwh-the-scripter/pen/WbGMvjR

How to reproduce?

Open the provided CodePen reproduction link.
Inspect the JavaScript code in the editor.

Notice the registerInterval function calls:

removeInterval(timer)

Scroll up to the removeInterval function definition.
Observe that removeInterval() does not accept any parameters, so the timer argument passed to it is unused.
This indicates an unnecessary argument being passed in the original implementation.

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Composables (quasar)

Platforms/Browsers

Chrome

Quasar info output

Relevant log output

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions