{"size": 533, "ext": "js", "max_stars_repo_path": "server/handlers/ship-update.js", "max_stars_repo_name": "fossabot/hull-browser", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/handlers/ship-update.js", "max_issues_repo_name": "fossabot/hull-browser", "max_issues_repo_issues_event_min_datetime": "2021-02-23T12:56:33.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-03T22:24:07.000Z", "max_forks_repo_path": "server/handlers/ship-update.js", "max_forks_repo_name": "fossabot/hull-browser", "max_forks_repo_forks_event_min_datetime": "2021-02-22T17:21:13.000Z", "max_forks_repo_forks_event_max_datetime": "2021-02-22T17:21:13.000Z"}
{"max_stars_count": null, "max_issues_count": 8, "max_forks_count": 1, "avg_line_length": 31.3529411765, "max_line_length": 75, "alphanum_fraction": 0.6285178236}
export default function shipUpdateFactory({ store, onConnection, io }) {
  return async function shipUpdate(ctx) {
    const { config = {} } = ctx;
    const { ship } = config;
    if (!ship) return Promise.reject();
    try {
      await store.setup(ctx, io);
      if (store.pool(ship)) return true;
      const setupOnConnection = io.of(ship).on("connection", onConnection);
      return Promise.resolve(store.pool(ship, setupOnConnection));
    } catch (err) {
      console.log(err);
      return Promise.reject();
    }
  };
}
