Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
amorey authored Sep 18, 2017
1 parent ecfbbc3 commit e2e09a2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ on(cssSelectors, callbackFn)
Examples:
Use the `on()` method to set up a watch for new DOM nodes:
Use the `on()` method to set up a watch for new DOM nodes:
sentinel.on(['.my-div1', '.my-div2'], function(el) {
// add an input box
var inputEl = document.createElement('input');
el.appendChild(inputEl);
});
Use single css selector strings:
Use single css selector strings:
sentinel.on('.my-div', function(el) {
// add an input box
Expand All @@ -115,12 +115,12 @@ Use single css selector strings:
```
off(cssSelectors[, callbackFn])
* cssSelectors {Array or String} - A single selector string or an array
* callbackFn {Function} - The callback function you want to remove the watch for (optional)
* cssSelectors {Array or String} - A single selector string or an array
* callbackFn {Function} - The callback function you want to remove the watch for (optional)
Examples:
Remove a watch callback:
Remove a watch callback:
function callbackFn() {
// add an input box
Expand All @@ -134,7 +134,7 @@ Remove a watch callback:
// remove listener
sentinel.off('.my-div', callbackFn);
Remove a watch:
Remove a watch:
// add multiple callbacks
sentinel.on('.my-div', function fn1(el) {});
Expand All @@ -151,7 +151,7 @@ reset()
Examples:
Remove all watches and callbacks from the sentinel library:
Remove all watches and callbacks from the sentinel library:
// add multiple callbacks
sentinel.on('.my-div1', function fn1(el) {});
Expand Down

0 comments on commit e2e09a2

Please sign in to comment.