Move forwardEvent to Events.ts
This commit is contained in:
@@ -44,7 +44,7 @@ import { ICharSizeService, ICharacterJoinerService, ICoreBrowserService, ILinkPr
|
||||
import { ThemeService } from 'browser/services/ThemeService';
|
||||
import { channels, color } from 'common/Color';
|
||||
import { CoreTerminal } from 'common/CoreTerminal';
|
||||
import { forwardEvent } from 'common/EventEmitter';
|
||||
import { forwardEvent } from 'common/Events';
|
||||
import { MutableDisposable, toDisposable } from 'common/Lifecycle';
|
||||
import * as Browser from 'common/Platform';
|
||||
import { ColorRequestType, CoreMouseAction, CoreMouseButton, CoreMouseEventType, IColorEvent, ITerminalOptions, KeyboardResultType, SpecialColorIndex } from 'common/Types';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { Disposable, MutableDisposable, toDisposable } from 'common/Lifecycle';
|
||||
import { ICoreBrowserService } from './Services';
|
||||
import { forwardEvent } from 'common/EventEmitter';
|
||||
import { forwardEvent } from 'common/Events';
|
||||
import { addDisposableDomListener } from 'browser/Lifecycle';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import { BufferService, MINIMUM_COLS, MINIMUM_ROWS } from 'common/services/Buffe
|
||||
import { OptionsService } from 'common/services/OptionsService';
|
||||
import { IDisposable, IAttributeData, ICoreTerminal, IScrollEvent } from 'common/Types';
|
||||
import { CoreService } from 'common/services/CoreService';
|
||||
import { forwardEvent } from 'common/EventEmitter';
|
||||
import { forwardEvent } from 'common/Events';
|
||||
import { CoreMouseService } from 'common/services/CoreMouseService';
|
||||
import { UnicodeService } from 'common/services/UnicodeService';
|
||||
import { CharsetService } from 'common/services/CharsetService';
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
|
||||
describe('EventEmitter', () => {
|
||||
it('should fire listeners multiple times', () => {
|
||||
const order: string[] = [];
|
||||
const emitter = new Emitter<number>();
|
||||
emitter.event(data => order.push(data + 'a'));
|
||||
emitter.event(data => order.push(data + 'b'));
|
||||
emitter.fire(1);
|
||||
emitter.fire(2);
|
||||
assert.deepEqual(order, [ '1a', '1b', '2a', '2b' ]);
|
||||
});
|
||||
|
||||
it('should not fire listeners once disposed', () => {
|
||||
const order: string[] = [];
|
||||
const emitter = new Emitter<number>();
|
||||
emitter.event(data => order.push(data + 'a'));
|
||||
const disposeB = emitter.event(data => order.push(data + 'b'));
|
||||
emitter.event(data => order.push(data + 'c'));
|
||||
emitter.fire(1);
|
||||
disposeB.dispose();
|
||||
emitter.fire(2);
|
||||
assert.deepEqual(order, [ '1a', '1b', '1c', '2a', '2c' ]);
|
||||
});
|
||||
});
|
||||
@@ -24,7 +24,7 @@
|
||||
import { DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';
|
||||
import { IBuffer } from 'common/buffer/Types';
|
||||
import { CoreTerminal } from 'common/CoreTerminal';
|
||||
import { forwardEvent } from 'common/EventEmitter';
|
||||
import { forwardEvent } from 'common/Events';
|
||||
import { IMarker, ITerminalOptions } from 'common/Types';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user