Skip to content

Commit

Permalink
Merge branch 'pr/553’
Browse files Browse the repository at this point in the history
* pr/553:
  Optimized Events.trigger method when no event is emitted
  • Loading branch information
liabru committed Jun 12, 2018
2 parents 0d51fd1 + b17cb48 commit 7894b4b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/Events.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,17 @@ var Common = require('./Common');
callbacks,
eventClone;

if (object.events) {
var events = object.events;

if (events && Common.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 7894b4b

Please sign in to comment.