Skip to content

Commit

Permalink
Minor refactoring (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richienb committed Apr 6, 2020
1 parent 0ef0cd4 commit 3bc427f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const normalizeEmitter = emitter => {
};
};

const normalizeEvents = event => Array.isArray(event) ? event : [event];
const toArray = value => Array.isArray(value) ? value : [value];

const multiple = (emitter, event, options) => {
let cancel;
Expand All @@ -34,7 +34,7 @@ const multiple = (emitter, event, options) => {
}

// Allow multiple events
const events = normalizeEvents(event);
const events = toArray(event);

const items = [];
const {addListener, removeListener} = normalizeEmitter(emitter);
Expand Down

0 comments on commit 3bc427f

Please sign in to comment.