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

Feature: Document all event names #138

Open
yvesgurcan opened this issue Jan 30, 2020 · 0 comments
Open

Feature: Document all event names #138

yvesgurcan opened this issue Jan 30, 2020 · 0 comments
Labels
📖 documentation Improvements or additions to documentation

Comments

@yvesgurcan
Copy link
Owner

yvesgurcan commented Jan 30, 2020

Problem

Describe the problem related to this feature request.

It isn't clear from the documentation what the name of the events that are emitted is or when they get emitted.

Solution

What solution do you suggest to solve this problem?

Add these event names (such as MIDI_PLAY and MIDI_ERROR) to the documentation, using JSDoc.

In the documentation, the name of the events should be found in what the relevant methods of the EventHandler return.

For example, for the emitInit method, we could document what it returns with something like that:

 /*
     * Emits an event that indicates that the MIDI player is initialized.
     * @function
     * @param {undefined}
     * @return {object} payload
     * @return {string} payload.event `'MIDI_INIT'`
     * @return {string} payload.message `'MIDI player initialized.'`
  */

emitInit() {
this.emitEvent({
event: MIDI_INIT,
message: 'MIDI player initialized.'
});
}

@yvesgurcan yvesgurcan added the 📖 documentation Improvements or additions to documentation label Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant