Skip to content

Commit

Permalink
updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
amorey committed Sep 18, 2017
1 parent 6e24829 commit 424855e
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# sentineljs
# SentinelJS

SentinelJS is a tiny JS library that lets you detect new DOM nodes using CSS selectors.
<img src="https://www.muicss.com/static/images/sentinel.svg" width="250px">

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
Expand Down Expand Up @@ -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
<!doctype html>
<html>
Expand All @@ -71,4 +81,4 @@ SentinelJS is a tiny JS library that lets you detect new DOM nodes using CSS sel
</html>
```

```
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/)

0 comments on commit 424855e

Please sign in to comment.