How to use the event-kit.Disposable 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 npezza93 / archipelago / app / renderer / visor / visor.jsx View on Github external
bindListeners() {
    this.addSubscription(new Disposable(ipc.answerMain('split', this.split)))
    this.addSubscription(new Disposable(ipc.answerMain('close', this.state.tab.kill)))
    this.addSubscription(new Disposable(ipc.answerMain('setting-changed', this.handleSettingChanged)))
    this.addSubscription(new Disposable(ipc.answerMain('active-profile-changed', this.resetCssSettings)))
  }
}
github npezza93 / archipelago / app / renderer / app / tab-list.jsx View on Github external
bindListeners() {
    this.addSubscription(new Disposable(ipc.answerMain('setting-changed', this.resetStyles)))
    this.addSubscription(new Disposable(ipc.answerMain('active-profile-changed', this.resetStyles)))
  }
}
github npezza93 / archipelago / app / renderer / traffic-lights.jsx View on Github external
bindListeners() {
    if (this.props.currentProfile) {
      this.addSubscription(new Disposable(
        ipc.answerMain('setting-changed', ({property, value}) => {
          if (property === 'tabColor') {
            this.setState({backgroundColor: value})
          }
        })
      ))
      this.addSubscription(new Disposable(
        ipc.answerMain('active-profile-changed', () => {
          this.setState({backgroundColor: this.backgroundColor})
        })
      ))
    }
  }
}
github npezza93 / archipelago / app / renderer / app / hamburger-menu.jsx View on Github external
bindListeners() {
    if (!is.macos) {
      this.addSubscription(new Disposable(
        ipc.answerMain('setting-changed', ({property, value}) => {
          if (property === 'tabColor') {
            this.setState({backgroundColor: value})
          }
        })
      ))
      this.addSubscription(new Disposable(
        ipc.answerMain('active-profile-changed', () => {
          this.setState({backgroundColor: this.backgroundColor})
        })
      ))
    }
  }
}
github npezza93 / archipelago / app / renderer / about / about.jsx View on Github external
bindListeners() {
    this.addSubscription(
      new Disposable(darkMode.onChange(this.handleDarkModeChange.bind(this)))
    )

    ipc.on('close-via-menu', window.close)
    this.addSubscription(
      new Disposable(() => ipc.removeListener('close-via-menu', window.close))
    )
    ipc.answerMain('close', () => {
      return new Promise(resolve => {
        this.cleanup()
        resolve()
      })
    })
  }
}
github atom / github / lib / atom / commands.js View on Github external
constructor(props, context) {
    super(props, context);
    this.subTarget = new Disposable();
    this.subCommand = new Disposable();
  }
github atom / github / lib / atom / gutter.js View on Github external
constructor(props) {
    super(props);
    autobind(this, 'observeEditor', 'forceUpdate');

    this.state = {
      gutter: null,
    };

    this.sub = new Disposable();
  }
github atom / github / lib / atom / keystroke.js View on Github external
constructor(props) {
    super(props);
    autobind(this, 'didChangeTarget');

    this.sub = new Disposable();
    this.state = {keybinding: null};
  }
github atom / github / lib / containers / issueish-search-container.js View on Github external
constructor(props) {
    super(props);
    autobind(this, 'renderQueryResult');

    this.sub = new Disposable();
  }
github atom / github / lib / containers / current-pull-request-container.js View on Github external
constructor(props) {
    super(props);

    this.sub = new Disposable();
  }

event-kit

Simple library for implementing and consuming evented APIs

MIT
Latest version published 6 years ago

Package Health Score

51 / 100
Full package analysis