https://github.com/deebloo/observable-stage3-decorators
https://github.com/deebloo/observable-stage3-decorators
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/deebloo/observable-stage3-decorators
- Owner: deebloo
- Created: 2023-02-19T05:18:25.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-05T02:58:11.000Z (over 1 year ago)
- Last Synced: 2025-04-15T20:45:57.999Z (about 1 year ago)
- Language: TypeScript
- Size: 35.2 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# New Decorator Observable Props
Demonstrates a technique for monitoring property changes on a class instance using stage 3 decorators.
This should work with both plain classes and with custom elements. It is important that this does not require subclassing.
## Demo
make changes to src/main.ts to see changes
```shell
npm i
```
```shell
npm start --watch
```
```ts
import { computed, observe } from "./observe.js";
class State {
@observe accessor foo = "0";
@observe accessor bar = "false";
test = computed(() => this.foo + " " + this.bar)
}
```