How to use the event-kit.CompositeDisposable function in event-kit

To help you get started, we’ve selected a few event-kit 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 atom / github / lib / atom / panel.js View on Github external
constructor(props) {
    super(props);

    this.subscriptions = new CompositeDisposable();
    this.panel = null;
    this.didCloseItem = false;
    this.domNode = document.createElement('div');
    this.domNode.className = 'react-atom-panel';
  }
github atom / github / lib / atom / dock-item.js View on Github external
constructor(props) {
    super(props);

    this.subscriptions = new CompositeDisposable();
    this.dockItem = null;
    this.didCloseItem = false;
    if (props.stubItem) {
      this.domNode = this.props.stubItem.getElement();
    } else {
      this.domNode = document.createElement('div');
      this.domNode.className = 'react-atom-dockitem';
    }
  }
github atom / github / lib / items / stub-item.js View on Github external
constructor(name, props = {}, uri) {
    this.emitter = new Emitter();
    this.subscriptions = new CompositeDisposable();

    this.name = name;
    this.props = props;
    this.uri = uri;
    this.key = ++key;
    this.element = document.createElement('div');
    this.element.classList.add(`github-StubItem-${name}`);
    this.realItem = null;
    this.realItemPromise = new Promise(res => {
      this.resolveRealItemPromise = res;
    });
  }
github atom / github / lib / controllers / repository-conflict-controller.js View on Github external
constructor(props, context) {
    super(props, context);

    this.state = {openEditors: this.props.workspace.getTextEditors()};
    this.subscriptions = new CompositeDisposable();
  }
github atom / github / lib / controllers / comment-decorations-controller.js View on Github external
constructor(props, context) {
    super(props, context);

    this.subscriptions = new CompositeDisposable();
    this.state = {openEditors: this.props.workspace.getTextEditors()};
  }
github atom / atom / src / panel-container.js View on Github external
constructor({ location, dock, viewRegistry } = {}) {
    this.location = location;
    this.emitter = new Emitter();
    this.subscriptions = new CompositeDisposable();
    this.panels = [];
    this.dock = dock;
    this.viewRegistry = viewRegistry;
  }
github atom / atom / src / grammar-registry.js View on Github external
constructor ({config} = {}) {
    this.config = config
    this.subscriptions = new CompositeDisposable()
    this.textmateRegistry = new FirstMate.GrammarRegistry({maxTokensPerLine: 100, maxLineLength: 1000})
    this.clear()
  }
github atom / atom / src / auto-update-manager.js View on Github external
constructor({ applicationDelegate }) {
    this.applicationDelegate = applicationDelegate;
    this.subscriptions = new CompositeDisposable();
    this.emitter = new Emitter();
  }
github atom / teletype-client / lib / editor-proxy-metadata.js View on Github external
constructor ({id, bufferProxyId, bufferProxyURI, siteId, router, didDispose}) {
    this.id = id
    this.bufferProxyId = bufferProxyId
    this.bufferProxyURI = bufferProxyURI
    this.subscriptions = new CompositeDisposable()
    this.didDispose = didDispose || NOOP
    if (didDispose) {
      this.subscriptions.add(
        router.onNotification(`/buffers/${id}`, this.receiveBufferUpdate.bind(this))
      )
      this.subscriptions.add(
        router.onNotification(`/editors/${id}/disposal`, this.dispose.bind(this))
      )
    }
  }
github atom / teletype-client / lib / router.js View on Github external
constructor (network) {
    this.network = network
    this.emitter = new Emitter()
    this.subscriptions = new CompositeDisposable()
    this.subscriptions.add(network.onReceive(this.receive.bind(this)))
    this.nextRequestId = 0
    this.requestPromiseResolveCallbacks = new Map()
    this.peerIdsByRequestId = new Map()
    this.lastReceivePromise = Promise.resolve()
  }

event-kit

Simple library for implementing and consuming evented APIs

MIT
Latest version published 6 years ago

Package Health Score

53 / 100
Full package analysis