import GithubPackage from './github-package';

let pack;
const entry = {
  activate(...args) {
    pack = new GithubPackage(
      atom.workspace, atom.project, atom.commands, atom.notifications, atom.tooltips,
      atom.styles, atom.config, atom.confirm.bind(atom),
    );
    pack.activate(...args);
  },
};

[
  'serialize', 'deserialize', 'deactivate', 'consumeStatusBar',
  'createGitTimingsView', 'createIssueishPaneItem',
].forEach(method => {
  entry[method] = (...args) => {
    return pack[method](...args);
  };
});

module.exports = entry;

import GithubPackage from './github-package';

let pack;
const entry = {
  activate(...args) {
    pack.activate(...args);
  },

  initialize() {
    pack = new GithubPackage(
      atom.workspace, atom.project, atom.commands, atom.notifications, atom.tooltips,
      atom.styles, atom.config, atom.confirm.bind(atom),
    );
  },
};

[
  'serialize', 'deserialize', 'deactivate', 'consumeStatusBar',
  'createGitTimingsView', 'createIssueishPaneItem',
].forEach(method => {
  entry[method] = (...args) => {
    return pack[method](...args);
  };
});

module.exports = entry;

Create GithubPackage instance in `initialize` package hook
Create GithubPackage instance in `initialize` package hook

This ensures that the instance is available before any consume* or
deserialize* hooks are called
