Hacker News new | ask | show | jobs
by hombre_fatal 533 days ago
I haven't used that once since I found out that it exists.

I just don't see the point. It doesn't work in the browser and it shadows global.setTimeout which is confusing. Meanwhile the idiom works everywhere.

1 comments

You can alias it if you're worried about shadowing.

    import { setTimeout as loiter } from "node:timers/promises";
    await loiter(500);
Sure, and that competes with a universal idiom.

To me it's kinda like adding a shallowClone(old) helper instead of writing const obj = { ...old }.

But no point in arguing about it forever.