diff --git a/README.md b/README.md index 7461bea..41e2d40 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,13 @@ -# sentineljs +# SentinelJS -SentinelJS is a tiny JS library that lets you detect new DOM nodes using CSS selectors. + + +SentinelJS is a tiny JS library that lets you detect new DOM nodes using CSS selectors (682 bytes). ## Introduction +SentinelJS is a tiny JS library that makes it easier to set up watch functions that will notify you anytime a new DOM node is added that satisfies a CSS selector rule. + ## Quickstart ```html @@ -45,11 +49,17 @@ SentinelJS is a tiny JS library that lets you detect new DOM nodes using CSS sel ## Documentation ### API -* sentinel.on() -* sentinel.off() -* sentinel.one() + +#### on(cssSelectors, callbackFn) + +#### off(cssSelectors[, callbackFn]) + +#### reset() + ### Async Loading +To make it easy to use SentinelJS asynchronously, the library dispatches a `sentinel-load` event that will notify you when the library is ready to be used: + ```html @@ -71,4 +81,4 @@ SentinelJS is a tiny JS library that lets you detect new DOM nodes using CSS sel ``` -``` +Icons made by [Freepik](http://www.freepik.com) from [www.flaticon.com](https://www.flaticon.com/) is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/)