Skip to content

Commit

Permalink
added error on both before and after set to false
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanis Benson committed Jun 28, 2019
1 parent 7f80ef9 commit e00af5e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ module.exports = (fn, options = {}) => {
const before = (options.before === undefined) ? false : options.before;
const after = (options.after === undefined) ? true : options.after;

if (!before && !after) {
throw new Error('Both `before` and `after` are false, function wouldn\'t be called.');
}

let timeout;
let result;

Expand Down

0 comments on commit e00af5e

Please sign in to comment.