mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-22 23:50:52 +01:00
Remove event extension of NitroEvent
This commit is contained in:
parent
0aaac608b4
commit
27b64a1c0a
@ -4,6 +4,7 @@ import { IDisposable } from '../common/disposable/IDisposable';
|
||||
import { INitroLogger } from '../common/logger/INitroLogger';
|
||||
import { NitroLogger } from '../common/logger/NitroLogger';
|
||||
import { IEventDispatcher } from './IEventDispatcher';
|
||||
import { NitroEvent } from './NitroEvent';
|
||||
|
||||
export class EventDispatcher extends Disposable implements IEventDispatcher, IDisposable
|
||||
{
|
||||
@ -61,7 +62,7 @@ export class EventDispatcher extends Disposable implements IEventDispatcher, IDi
|
||||
}
|
||||
}
|
||||
|
||||
public dispatchEvent(event: Event): boolean
|
||||
public dispatchEvent(event: NitroEvent): boolean
|
||||
{
|
||||
if(!event) return false;
|
||||
|
||||
@ -72,7 +73,7 @@ export class EventDispatcher extends Disposable implements IEventDispatcher, IDi
|
||||
return true;
|
||||
}
|
||||
|
||||
private processEvent(event: Event): void
|
||||
private processEvent(event: NitroEvent): void
|
||||
{
|
||||
const existing = this._listeners.get(event.type);
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
import { IDisposable } from '../common/disposable/IDisposable';
|
||||
import { NitroEvent } from './NitroEvent';
|
||||
|
||||
export interface IEventDispatcher extends IDisposable
|
||||
{
|
||||
addEventListener(type: string, callback: Function): void
|
||||
removeEventListener(type: string, callback: Function): void;
|
||||
removeAllListeners(): void;
|
||||
dispatchEvent(event: Event): boolean;
|
||||
}
|
||||
dispatchEvent(event: NitroEvent): boolean;
|
||||
}
|
||||
|
@ -1,4 +1,14 @@
|
||||
export class NitroEvent extends Event
|
||||
export class NitroEvent
|
||||
{
|
||||
public static COMPLETE: string = 'NITRO_COMPLETE';
|
||||
}
|
||||
private _type: string;
|
||||
|
||||
constructor(type: string)
|
||||
{
|
||||
this._type = type;
|
||||
}
|
||||
|
||||
public get type(): string
|
||||
{
|
||||
return this._type;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user