# @iconplatforms/observe-property

> Observe for property changes with the power of Es6 Proxy and RxJS

Latest version **1.5.4** (published 2018-04-27) · Iconplatforms license · 0 weekly downloads

## Install

```sh
npm install @iconplatforms/observe-property
pnpm add @iconplatforms/observe-property
yarn add @iconplatforms/observe-property
bun add @iconplatforms/observe-property
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.4 |
| Published | 2018-04-27 |
| First published | 2018-04-26 |
| Weekly downloads | 0 |
| License | Iconplatforms |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | George Floros |
| Maintainers | florosg, georgefloros, iconplatforms |

## Links

- npm: https://www.npmjs.com/package/@iconplatforms/observe-property
- Repository: https://github.com/iconplatforms/observe-property
- Homepage: https://github.com/iconplatforms/observe-property/#README.md
- Issues: https://github.com/iconplatforms/observe-property/issues
- npm.io page: https://npm.io/package/@iconplatforms/observe-property

## Dependencies (1)

- [rxjs](https://npm.io/package/rxjs.md) ^6.0.0

## Recent versions

- 1.5.4 (latest) — 2018-04-27
- 1.5.3 — 2018-04-27
- 1.5.2 — 2018-04-27
- 1.5.1 — 2018-04-27
- 1.5.0 — 2018-04-26
- 1.4.33 — 2018-04-26
- 1.4.31 — 2018-04-26
- 1.4.30 — 2018-04-26
- 1.4.29 — 2018-04-26
- 1.4.28 — 2018-04-26
- 1.4.27 — 2018-04-26
- 1.4.26 — 2018-04-26

## README

# @iconplatforms/observe-property

> observe for property changes with the power of Es6 Proxy nad RxJS 


Uses the [`Proxy` API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) and [`RxJS` API] (https://reactivex.io/rxjs/).


## Install

```
$ npm install @iconplatforms/observe-property
```


## Usage

```
## TypeScript 
import {ObserveProperty} from '@iconplatforms/observe-property'
import { Subscription } from 'rxjs';

const obj = {
    name: 'test',
    surName: 'test 2'
}

const observer = new ObserveProperty(obj);

const sub$:Subscription = observer.observe('name').subscribe((value) =>{
    if(value === 'Test 6'){
        sub$.unsubscribe();
    }
});

setTimeout(() => {
    obj.name = "Test 6";
    obj.name = "Test 10";
}, 2000); 
```

```
## JavaScript 
"use strict";

var ObserveProperty = require("@iconplatforms/observe-property");

var obj = {
    name: 'test',
    surName: 'test 2'
};
const observer = new ObserveProperty(obj);

const sub$:Subscription = observer.observe('name').subscribe((value) =>{
    if(value === 'Test 6'){
        sub$.unsubscribe();
    }
});

setTimeout(() => {
    obj.name = "Test 6";
    obj.name = "Test 10";
}, 2000); 
```

## API

### observe (property: string):BehaviorSubject<any>{
Type: `Function`
Returns an Observable Object.

## License
MIT © [IconPlatforms](https://www.iconplatforms.com)

---
_Source: https://npm.io/package/@iconplatforms/observe-property · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
