Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Package Activation

Even Stensberg edited this page Mar 24, 2017 · 2 revisions

This page discusses how to activate (and deactivate) Nuclide packages.

General Guidelines

  • Export activate and deactivate functions from lib/main.js
  • Export any other functions needed by the service declarations in package.json
  • There's no need for an Activation class for simple packages
  • Type the package's disposables collection (named subscriptions) with (null: any)
  • As much as possible, lazy-load require calls to invoke business logic of the package

Using requires

When using require to have a command invoke core logic of the package, wrap it in an arrow function.

atom.commands.add('atom-workspace' 'your-package:command', e => {
  require('./your-package-utils').commandMethod(e);
});