How to use the atom.CompositeDisposable function in atom

To help you get started, we’ve selected a few atom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Polymer / atom-plugin / lib / polymer-ide.js View on Github external
activate(_) {
        // Initialize.
        this.linter = new Linter();
        this.autocompleter = new Autocompleter();
        // Events subscribed to in atom's system can be easily cleaned up with a
        // CompositeDisposable
        this.subscriptions = new CompositeDisposable();
        this.subscriptions.add(atom.project.onDidChangePaths((projectPaths) => {
            this.setProjectPaths(projectPaths);
        }));
        this.setProjectPaths(atom.project.getPaths());
        this.subscriptions.add(new TooltipManager(this.editorService));
    }
    ;
github Polymer / atom-plugin / src / polymer-ide.ts View on Github external
activate(_: ViewState) {
    // Initialize.
    this.linter = new Linter();
    this.autocompleter = new Autocompleter();

    // Events subscribed to in atom's system can be easily cleaned up with a
    // CompositeDisposable
    this.subscriptions = new CompositeDisposable();

    this.subscriptions.add(
        atom.project.onDidChangePaths((projectPaths: string[]) => {
          this.setProjectPaths(projectPaths);
        }));
    this.setProjectPaths(atom.project.getPaths());
    this.subscriptions.add(new TooltipManager(this.editorService));
  };
github atom / github / lib / views / git-panel-view.js View on Github external
constructor(props) {
    this.props = props;
    etch.initialize(this);

    this.element.addEventListener('focusin', this.rememberLastFocus);

    this.subscriptions = new CompositeDisposable(
      this.props.commandRegistry.add(this.element, {
        'tool-panel:unfocus': this.blur,
        'core:focus-next': this.advanceFocus,
        'core:focus-previous': this.retreatFocus,
      }),
      new Disposable(() => this.element.removeEventListener('focusin', this.rememberLastFocus)),
    );
  }
github AtomLinter / linter-markdown / lib / config.js View on Github external
function on() {
  subscriptions = new CompositeDisposable();

  subscriptions.add(atom.config.observe('linter-markdown.presetRecommendedWithoutConfig', (value) => {
    presetRecommendedWithoutConfig = value;
  }));

  subscriptions.add(atom.config.observe('linter-markdown.presetConsistentWithoutConfig', (value) => {
    presetConsistentWithoutConfig = value;
  }));
}
github tststs / atom-ternjs / lib / atom-ternjs.js View on Github external
activate() {

    this.subscriptions = new CompositeDisposable();

    this.subscriptions.add(
      atom.packages.onDidActivateInitialPackages(function() {

        if (!atom.inSpecMode()) {

          require('atom-package-deps').install('atom-ternjs', true);
        }
      })
    );

    manager.activate();
  }

atom

shared, synchronous, independent state for javascript apps

ISC
Latest version published 1 year ago

Package Health Score

46 / 100
Full package analysis