Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deebloo/observable-stage3-decorators
https://github.com/deebloo/observable-stage3-decorators
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/deebloo/observable-stage3-decorators
- Owner: deebloo
- Created: 2023-02-19T05:18:25.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-09T16:27:00.000Z (4 months ago)
- Last Synced: 2024-10-05T13:07:41.287Z (3 months 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)
}
```