js-signals icon indicating copy to clipboard operation
js-signals copied to clipboard

Documentation doesn't mention listeners can return false

Open Sjeiti opened this issue 9 years ago • 1 comments

The documentation doesn't mention listeners returning false will stop execution of subsequent listeners. I had to find out by debugging and digging through the code.

The jsdoc on the add method should be updated to something like

* @param {Function} listener Signal handler function. When a listener returns false, subsequent listeners are not executed.

(I could create a pull request but that's a bit overkill for such a small change, plus I would not be able to run the shell script to update the documentation anyway)

Sjeiti avatar Sep 28 '16 08:09 Sjeiti

That'd be a good change.

It is documented over in the examples, but it would be best if it was in both places.

Stop/Halt Propagation (method 2)

ghost avatar Jan 13 '17 17:01 ghost