Skip to content

doc: fix recommendation of setImmediate() over process.nextTick() #30801

Closed
nodejs/nodejs.org
#2827
@davalapar

Description

@davalapar

Is your feature request related to a problem? Please describe.

On this url:

At the process.nextTick() section, it says:

We recommend developers use setImmediate() in all cases because it's easier to reason about (and it leads to code that's compatible with a wider variety of environments, like browser JS.)

But this is untrue since setImmediate() isn't supported in "wider variety of environments". Only supported in Edge & IE, but not Chrome, Firefox, Safari (on both desktop and mobile platforms).

Describe the solution you'd like

  • remove that last phrase "(and it leads to code that's compatible with a wider variety of environments, like browser JS.)"?

Describe alternatives you've considered

  • I think setTimeout and window.requestAnimationFrame are the nearest alternatives for setImmediate for the browser, but I don't know how to phrase it yet

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.good first issueIssues that are suitable for first-time contributors.timersIssues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions