/** * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */ 'use strict'; import utils from './utils.js'; /** * The event object passed to event callbacks. It is used to provide information about the event as well as a tool to * manipulate it. * * @memberOf core */ export default class EventInfo { constructor( source, name ) { /** * The object that fired the event. * * @member core.EventInfo#source */ this.source = source; /** * The event name. * * @member core.EventInfo#name */ this.name = name; // The following methods are defined in the constructor because they must be re-created per instance. /** * Stops the event emitter to call further callbacks for this event interaction. * * @method core.EventInfo#stop */ this.stop = utils.spy(); /** * Removes the current callback from future interactions of this event. * * @method core.EventInfo#off */ this.off = utils.spy(); } }