Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fabioricali/spyo

Observe an object, check when it's change.
https://github.com/fabioricali/spyo

changed observer watching

Last synced: 22 days ago
JSON representation

Observe an object, check when it's change.

Awesome Lists containing this project

README

        

# Spyo
Observe an object, check when it's change.


## Installation

### Node.js
```
npm install spyo --save
```

### Browser

#### Local
```html

```

#### CDN unpkg
```html

```

## Example
```javascript
const Spyo = require('spyo');

const myObject = {
firstName: 'Mike',
lastName: 'Red'
};

const mySpy = new Spyo(myObject);

myObject.firstName = 'John';

mySpy.onChange((different) => {
console.log('is different:', different);
});
```

## Use provider function
```javascript
const mySpy = new Spyo(() => {
return Math.random();
});

mySpy.onChange((different) => {
console.log('is different:', different);
});
```

## API

{{>main}}

## Changelog
You can view the changelog here

## License
Spyo is open-sourced software licensed under the MIT license

## Author
Fabio Ricali