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

https://github.com/duart38/accessors

Accessor decoration made easier
https://github.com/duart38/accessors

accessor decorators deno javascript typescript

Last synced: about 2 months ago
JSON representation

Accessor decoration made easier

Awesome Lists containing this project

README

          

# How it works

```typescript
import { decorateAccessors } from "./mod.ts";

const myObj = {
name: "John",
age: 34,
};

const p = decorateAccessors(myObj, (v) => {
console.log(v); // new value
// do something when setter is called
});

// now you can just assign values and have the call-back triggered
p.age = 9999;
```