Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to accumulate events during mute and dispatch them after unmute #1

Merged
merged 3 commits into from
May 24, 2016
Merged

Ability to accumulate events during mute and dispatch them after unmute #1

merged 3 commits into from
May 24, 2016

Conversation

stamoern
Copy link
Collaborator

No description provided.

}
}

/**
* Mute channel
* @param {Object} [options]
* @param {Boolean} [options.accumulate]
Copy link
Owner

@vitalets vitalets May 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add description: accumulate events and call listeners after .unmute()

@stamoern
Copy link
Collaborator Author

Update: separate variable for storing accumulated events added

* @private
*/
_dispatchAccumulated () {
this._accumulatedEvents.forEach(args => this.dispatch.apply(this, args));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suggest to clear this._accumulatedEvents here instead of in unmute () as it seems to me more consistent to always clear list after dispatching.

this._accumulatedEvents.lenght = 0;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Updated

@vitalets vitalets merged commit 4280d5a into vitalets:master May 24, 2016
@vitalets
Copy link
Owner

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants