Skip to content

Commit

Permalink
Optimized Events.trigger method when no event is emitted
Browse files Browse the repository at this point in the history
  • Loading branch information
bchevalier committed Jan 6, 2018
1 parent 0895d81 commit b17cb48
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/Events.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,16 @@ var Common = require('./Common');
callbacks,
eventClone;

if (object.events) {
var events = object.events;
if (events && Object.keys(events).length > 0) {
if (!event)
event = {};

names = eventNames.split(' ');

for (var i = 0; i < names.length; i++) {
name = names[i];
callbacks = object.events[name];
callbacks = events[name];

if (callbacks) {
eventClone = Common.clone(event, false);
Expand Down

0 comments on commit b17cb48

Please sign in to comment.