How to use the atom.Emitter 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 appcelerator / atom-appcelerator-titanium / lib / toolbar / select.js View on Github external
constructor(options) {
      this.element = document.createElement('select');
      this.element.classList.add('select', 'element');
      this.element.style.width = options.width;

      this.emitter = new Emitter();
      this.element.onchange = function(e){
          var selectedOption = this.element.options[this.element.selectedIndex];
          this.emitter.emit('change', {text: selectedOption.text, value: selectedOption.value});
      }.bind(this);
    }
github atom / github / lib / git / commit-box / commit-box-view-model.js View on Github external
constructor (gitStore: GitStore) {
    this.emitter = new Emitter()
    this.gitStore = gitStore
  }
github benogle / kitty-detect / lib / kitty-canvas.js View on Github external
constructor(delay) {
    this.events = []
    this.ranEvents = []
    this.delay = delay
    this.isRunning = false
    this.emitter = new Emitter()
  }
github Stepsize / atom-better-git-blame / dist / interface / GutterItem.js View on Github external
constructor(data) {
        this.data = data;
        this.itemElement = document.createElement('div');
        this.itemElement.className = 'layer-gutter-item';
        this.itemElement.style['width'] = '100%';
        this.contentElement = document.createElement('div');
        this.itemElement.appendChild(this.contentElement);
        const resizeHandle = new GutterResizeHandle();
        this.resizeEmitter = resizeHandle.emitter;
        this.itemElement.appendChild(resizeHandle.element());
        this.emitter = new Emitter();
        this.boundMouseEnterListener = this.mouseEnterListener.bind(this);
        this.boundMouseLeaveListener = this.mouseLeaveListener.bind(this);
        this.itemElement.addEventListener('mouseenter', this.boundMouseEnterListener);
    }
    setIndicator(value) {
github Stepsize / atom-better-git-blame / dist / interface / GutterResizeHandle.js View on Github external
constructor() {
        this.handleElement = document.createElement('div');
        this.handleElement.className = 'layer-resize-handle';
        this.emitter = new Emitter();
        this.boundMouseDownListener = this.mouseDownListener.bind(this);
        this.boundMouseUpListener = this.mouseUpListener.bind(this);
        this.boundMouseMoveListener = this.mouseMoveListener.bind(this);
        this.handleElement.addEventListener('mousedown', this.boundMouseDownListener);
    }
    mouseDownListener(event) {

atom

shared, synchronous, independent state for javascript apps

ISC
Latest version published 1 year ago

Package Health Score

46 / 100
Full package analysis