Skip to content

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

@gautamz07

Description

@gautamz07

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions