Title: Should `nextTick` and timers accept context or parameters? · Issue #953 · nodejs/node · GitHub
Open Graph Title: Should `nextTick` and timers accept context or parameters? · Issue #953 · nodejs/node
X Title: Should `nextTick` and timers accept context or parameters? · Issue #953 · nodejs/node
Description: Currently, both timers and nextTick only take a callback argument (and some timers take a duration argument). It is beneficial to pass additional arguments and/or the context to timers. The io.js code base is littered with code like: var...
Open Graph Description: Currently, both timers and nextTick only take a callback argument (and some timers take a duration argument). It is beneficial to pass additional arguments and/or the context to timers. The io.js c...
X Description: Currently, both timers and nextTick only take a callback argument (and some timers take a duration argument). It is beneficial to pass additional arguments and/or the context to timers. The io.js c...
Opengraph URL: https://github.com/nodejs/node/issues/953
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Should `nextTick` and timers accept context or parameters?","articleBody":"Currently, both timers and `nextTick` only take a callback argument (and some timers take a duration argument).\n\nIt is beneficial to pass additional arguments and/or the context to timers. The io.js code base is littered with code like:\n\n``` js\n var self = this;\n process.nextTick(function() {\n self.emit('close');\n });\n```\n\nIt's possible to either pass a context (`this`) to these functions or to pass arguments like the DOM version does making the above:\n\n``` js\n process.nextTick(function() {\n this.emit('close');\n }, this);\n```\n\nOr:\n\n``` js\n process.nextTick(function(element) {\n element.emit('close');\n }, this);\n```\n\nThis can make cleaner code and save closure allocations - it also isn't slow like `.bind`. \n\nWas this proposed before? \n\nI realize the Timers API is locked (`nextTick` is not afaict) but I'm wondering how people feel about this.\n","author":{"url":"https://github.com/benjamingr","@type":"Person","name":"benjamingr"},"datePublished":"2015-02-25T11:34:18Z","url":"https://github.com/nodejs/node/issues/953"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5b451abc-4c81-7507-2cab-b90e10b5b7e3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A720:38E6D:5EBDD2:7B802F:6AED2C2A |
| html-safe-nonce | 41784de0f8fcbc4ff524fcb9b312daa21cc3ebc84bb183f2de1b5546f6876ad1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzIwOjM4RTZEOjVFQkREMjo3QjgwMkY6NkFFRDJDMkEiLCJ2aXNpdG9yX2lkIjoiODMzMzA2MDg0MTg2MjQwOTI1OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a468d12b76cf0e048932dc6d62b3308c95ccf3fcedf755be491b8c9395593adc |
| hovercard-subject-tag | issue:58888132 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/953/issue_layout |
| twitter:image | https://opengraph.githubassets.com/63766218050a5e5b64bf08c18a594397fe2ac56f1d27fa814276e79ce142310a/nodejs/node/issues/953 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/63766218050a5e5b64bf08c18a594397fe2ac56f1d27fa814276e79ce142310a/nodejs/node/issues/953 |
| og:image:alt | Currently, both timers and nextTick only take a callback argument (and some timers take a duration argument). It is beneficial to pass additional arguments and/or the context to timers. The io.js c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | benjamingr |
| hostname | github.com |
| expected-hostname | github.com |
| None | e51d0b7b5ab34b1688c05b54c3ed17b8658b2fa9bca973a9c740683ccb12cf4a |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 59ebb7b901cc154ecc179a44f266fcf69f343b30 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width