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

https://github.com/1amageek/classy

classy provides getter / setter to typescript.
https://github.com/1amageek/classy

getter setter typescript typescript-library

Last synced: 3 months ago
JSON representation

classy provides getter / setter to typescript.

Awesome Lists containing this project

README

          

# classy

classy provides getter / setter to typescript.

## Install

```
npm add @1amageek/classy
```

## Usage
```typescript

import { classy, property } from '@1amageek/classy'

@classy
export class Document {

// willSet / didSet
@property({
willSet: (newValue) => {
console.log(newValue)
},
didSet: (oldValue) => {
console.log(oldValue)
}
}) public test0: string

_privateValue: string

// getter / setter
@property({
set: (newValue, self) => {
self._privateValue = newValue
},
get: (self) => {
return self._privateValue
}
}) public test1: string

constructor() {

}
}
```