Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just a dev question - Why extend from eventEmitter when the methods are never used (hexo-cli) ? #488

Closed
gautamz07 opened this issue Aug 9, 2023 · 0 comments · Fixed by #489

Comments

@gautamz07
Copy link

Why have class Context extend EventEmitter at all ? in the package hexoc-cli i don't see the methods of EventEmitter used at all, so why extend from this class ?

I see context is defined HERE like so :-

class Context extends EventEmitter { // code here }

and then ofcourse being used in the index(hexo.ts) file like so LINK :-

function entry(cwd = process.cwd(), args) {
  args = camelCaseKeys(
      args || minimist(process.argv.slice(2), 
      { string: ['_', 'p', 'path', 's' ,'slug'] 
  }));

  let hexo = new Context(cwd, args);
  // more code here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant