Skip to content

Commit

Permalink
Docs: Add API section to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed May 14, 2018
1 parent 3dbeeb0 commit d637d70
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,18 @@ sparkles.on('my-event', function(evt){
sparkles.emit('my-event', { my: 'event' });
```

# Why the name?
## API

### sparkles(namespace)

Returns an EventEmitter that is shared amongst the provided namespace. If no namespace
is provided, returns a default EventEmitter.

### sparkles.exists(namespace);

Checks whether a namespace exists and returns true or false.

## Why the name?

This is a "global emitter"; shortened: "glitter" but it was already taken; so we got sparkles instead :smile:

Expand Down

0 comments on commit d637d70

Please sign in to comment.