Skip to content

Commit

Permalink
Emit event immediately if only 1 mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Jul 31, 2018
1 parent 8d102b6 commit e19a4d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modules/observer/observer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ const Observer = {
// The observerUpdate event should only be triggered
// once despite the number of mutations. Additional
// triggers are redundant and are very costly
if (mutations.length === 1) {
swiper.emit('observerUpdate', mutations[0]);
return;
}
const observerUpdate = function observerUpdate() {
swiper.emit('observerUpdate', mutations[0]);
};
Expand Down

0 comments on commit e19a4d2

Please sign in to comment.