# property-connector

> Just a decorator for connect with subject and transform properties in observable on multiple channels.

Latest version **0.0.3** (published 2023-02-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install property-connector
pnpm add property-connector
yarn add property-connector
bun add property-connector
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2023-02-19 |
| First published | 2023-02-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | RMINGON |
| Maintainers | rmingon |
| Keywords | decorator, subject, observable |

## Links

- npm: https://www.npmjs.com/package/property-connector
- Repository: https://github.com/rmingon/property-connector
- Homepage: https://github.com/rmingon/property-connector#readme
- Issues: https://github.com/rmingon/property-connector/issues
- npm.io page: https://npm.io/package/property-connector

## Dependencies (1)

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

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2023-02-19
- 0.0.2 — 2023-02-19
- 0.0.1 — 2023-02-19

## README

# Property connector with channel name

##### This library is maybe not a good practice and you can probably make it by yourself

### @Connector(channel_name)

### Install
```bash
   npm i property-connector
```

### Use
```typescript
import Connector from "property-connector";

class Bar {
  @Connector('users')
  users: Subject<any> | undefined
}

class Foo {
  @Connector('users')
  users: Subject<any> | undefined
}

let foo = new Foo()
foo.users?.subscribe((next) => console.log(next))

let bar = new Bar()
bar.users?.next({
  name: "John"
})


class Zerg {
  @Connector('login')
  loginEvent: Subject<any> | undefined

  login(mail: string, pass: string) {
    this.loginEvent?.next({mail, pass})
  }
}

class Log {
  @Connector('login')
  loginEvent: Subject<any> | undefined
}

let log = new Log()
log.loginEvent?.subscribe(log => console.log(log))

let zerg = new Zerg()
zerg.login("test@test.fr", "password")
```

### Result
```bash
  npm run dev
    { name: 'John' }
    { mail: 'test@test.fr', pass: 'password' }
```

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