On Fri, Jun 1, 2012 at 1:33 AM, Isaac Schlueter <[email protected]> wrote: > var request = http.get(options, function (response) { }) > // vs > var request = http.get(options).on('response', function (response) { }) > > var watcher = fs.watch(filename, function (change) { }) > // vs > var watcher = fs.watch(filename).on('change', function (change) { }) > > Almost every EventEmitter subclass in node core has some factor > creator that lets you attach a listener to its most relevant event > when creating it. This is a very consistent pattern.
Why is this? Whats the purpose of that -yes- consistent pattern? -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
