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

https://github.com/stagas/setter-decorator

decorator that attaches setters to class properties
https://github.com/stagas/setter-decorator

decorator property setter

Last synced: about 1 year ago
JSON representation

decorator that attaches setters to class properties

Awesome Lists containing this project

README

          

setter-decorator


decorator that attaches setters to properties


🔧 Install
· 🧩 Example
· 📜 API docs
· 🔥 Releases
· 💪🏼 Contribute
· 🖐️ Help

***

## Install

```sh
$ npm i setter-decorator
```

## API

#### Table of Contents

* [settable](#settable)
* [Parameters](#parameters)
* [setter](#setter)
* [Parameters](#parameters-1)

### settable

[src/index.ts:35-82](https://github.com/stagas/setter-decorator/blob/572b4c74029e822f2e0a8c79ca87b1bc97c016dd/src/index.ts#L35-L82 "Source code on GitHub")

Decorates a class as `@settable`. This is required for `@setter` to work.

```ts
```

#### Parameters

* `ctor` **any** The class to decorate

Returns **any** The decorated class

### setter

[src/index.ts:122-143](https://github.com/stagas/setter-decorator/blob/572b4c74029e822f2e0a8c79ca87b1bc97c016dd/src/index.ts#L122-L143 "Source code on GitHub")

Attaches a `@setter` to a property.

```ts
```

#### Parameters

* `fn` **Setter** The setter function

Returns **PropertyDecorator** A property decorator

## Contribute

[Fork](https://github.com/stagas/setter-decorator/fork) or
[edit](https://github.dev/stagas/setter-decorator) and submit a PR.

All contributions are welcome!

## License

MIT © 2021
[stagas](https://github.com/stagas)