[![view on npm](https://badgen.net/npm/v/obso)](https://www.npmjs.org/package/obso)
[![npm module downloads](https://badgen.net/npm/dt/obso)](https://www.npmjs.org/package/obso)
[![Gihub repo dependents](https://badgen.net/github/dependents-repo/75lb/obso)](https://github.com/75lb/obso/network/dependents?dependent_type=REPOSITORY)
[![Gihub package dependents](https://badgen.net/github/dependents-pkg/75lb/obso)](https://github.com/75lb/obso/network/dependents?dependent_type=PACKAGE)
[![Build Status](https://travis-ci.org/75lb/obso.svg?branch=master)](https://travis-ci.org/75lb/obso)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)

# obso

Make an object observable.

```js
import Emitter from 'obso/index.mjs'
class Something extends Emitter {}
const something = new Something()
something.on('load', () => {
  console.log('load event fired.')
})
```

{{>main}}

### Load anywhere

This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.

Node.js:

```js
const Emitter = require('obso')
```

Within Node.js with ECMAScript Module support enabled:

```js
import Emitter from 'obso/index.mjs'
```

Within an modern browser ECMAScript Module:

```js
import Emitter from './node_modules/obso/index.mjs'
```

Old browser (adds `window.Emitter`):

```html
<script nomodule src="./node_modules/obso/dist/index.js"></script>
```

* * *

&copy; 2018-21 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).
