UNPKG

atom-nuclide

Version:

A unified developer experience for web and mobile development, built as a suite of features on top of Atom to provide hackability and the support of an active community.

71 lines (58 loc) 2.47 kB
Object.defineProperty(exports, '__esModule', { value: true }); /* * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the license found in the LICENSE file in * the root directory of this source tree. */ var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } var _atom2; function _atom() { return _atom2 = require('atom'); } var _Constants2; function _Constants() { return _Constants2 = require('./Constants'); } var ATTACH_TARGET_LIST_CHANGE_EVENT = 'ATTACH_TARGET_LIST_CHANGE_EVENT'; var LaunchAttachStore = (function () { function LaunchAttachStore(dispatcher) { _classCallCheck(this, LaunchAttachStore); this._dispatcher = dispatcher; this._dispatcherToken = this._dispatcher.register(this._handleActions.bind(this)); this._emitter = new (_atom2 || _atom()).Emitter(); this._attachTargetInfos = []; } _createClass(LaunchAttachStore, [{ key: 'dispose', value: function dispose() { this._dispatcher.unregister(this._dispatcherToken); } }, { key: 'onAttachTargetListChanged', value: function onAttachTargetListChanged(callback) { return this._emitter.on(ATTACH_TARGET_LIST_CHANGE_EVENT, callback); } }, { key: '_handleActions', value: function _handleActions(args) { switch (args.actionType) { case (_Constants2 || _Constants()).LaunchAttachActionCode.UPDATE_ATTACH_TARGET_LIST: this._attachTargetInfos = args.data; this._emitter.emit(ATTACH_TARGET_LIST_CHANGE_EVENT); break; } } }, { key: 'getAttachTargetInfos', value: function getAttachTargetInfos() { return this._attachTargetInfos; } }]); return LaunchAttachStore; })(); exports.LaunchAttachStore = LaunchAttachStore;