Skip to content

Commit

Permalink
Tweaked annyang.removeCallback() documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
TalAter committed Jan 27, 2016
1 parent 74bb656 commit 84936f6
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 17 deletions.
11 changes: 7 additions & 4 deletions annyang.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,17 @@
* annyang.addCallback('end', myFunction1);
* annyang.addCallback('end', myFunction2);
*
* // Remove myFunction2 from being called on start:
* annyang.removeCallback('start', myFunction2);
* // Remove all callbacks from all events:
* annyang.removeCallback();
*
* // Remove all callbacks attached to end event:
* annyang.removeCallback('end');
*
* // Remove all callbacks from all events:
* annyang.removeCallback();
* // Remove myFunction2 from being called on start:
* annyang.removeCallback('start', myFunction2);
*
* // Remove myFunction1 from being called on all events:
* annyang.removeCallback(undefined, myFunction1);
* ````
*
* @param type Name of event type to remove callback from
Expand Down
11 changes: 7 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,17 @@ annyang.addCallback('start', myFunction2);
annyang.addCallback('end', myFunction1);
annyang.addCallback('end', myFunction2);

// Remove myFunction2 from being called on start:
annyang.removeCallback('start', myFunction2);
// Remove all callbacks from all events:
annyang.removeCallback();

// Remove all callbacks attached to end event:
annyang.removeCallback('end');

// Remove all callbacks from all events:
annyang.removeCallback();
// Remove myFunction2 from being called on start:
annyang.removeCallback('start', myFunction2);

// Remove myFunction1 from being called on all events:
annyang.removeCallback(undefined, myFunction1);
````

### Params:
Expand Down
21 changes: 15 additions & 6 deletions test/coverage/__root__/annyang.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,10 @@ <h1>
710
711
712
713</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
713
714
715
716</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand Down Expand Up @@ -1254,6 +1257,9 @@ <h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes"></span>
<span class="cline-any cline-yes">11×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand Down Expand Up @@ -1950,14 +1956,17 @@ <h1>
* annyang.addCallback('end', myFunction1);
* annyang.addCallback('end', myFunction2);
*
* // Remove myFunction2 from being called on start:
* annyang.removeCallback('start', myFunction2);
* // Remove all callbacks from all events:
* annyang.removeCallback();
*
* // Remove all callbacks attached to end event:
* annyang.removeCallback('end');
*
* // Remove all callbacks from all events:
* annyang.removeCallback();
* // Remove myFunction2 from being called on start:
* annyang.removeCallback('start', myFunction2);
*
* // Remove myFunction1 from being called on all events:
* annyang.removeCallback(undefined, myFunction1);
* ````
*
* @param type Name of event type to remove callback from
Expand Down Expand Up @@ -2185,7 +2194,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jan 27 2016 10:00:40 GMT+0200 (IST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jan 27 2016 10:04:49 GMT+0200 (IST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion test/coverage/__root__/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jan 27 2016 10:00:40 GMT+0200 (IST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jan 27 2016 10:04:49 GMT+0200 (IST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion test/coverage/coverage.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/coverage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jan 27 2016 10:00:40 GMT+0200 (IST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jan 27 2016 10:04:49 GMT+0200 (IST)
</div>
</div>
<script src="prettify.js"></script>
Expand Down

0 comments on commit 84936f6

Please sign in to comment.