https://github.com/jeremylikness/tsviewmodel
ViewModel implementation in TypeScript using decorators for property change notifications
https://github.com/jeremylikness/tsviewmodel
Last synced: 2 months ago
JSON representation
ViewModel implementation in TypeScript using decorators for property change notifications
- Host: GitHub
- URL: https://github.com/jeremylikness/tsviewmodel
- Owner: JeremyLikness
- License: mit
- Created: 2018-03-28T17:54:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-28T17:54:20.000Z (about 7 years ago)
- Last Synced: 2025-01-14T03:13:42.147Z (4 months ago)
- Language: TypeScript
- Size: 2.93 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Property change notification in TypeScript
This is a simple example that demonstrates how to use TypeScript decorators to transform simple properties into "view model" properties that raise events when the value changes. This works by intercepting the setter and invoking a callback when the setter value is different. The property is turned into a getter/setter with a backing property.
## Make it rain
`git clone https://github.com/JeremyLikness/tsviewmodel.git`
`cd tsviewmodel`
`npm i`
`npm run-script build`
`node index`
That's it. Feedback: [@JeremyLikness](https://twitter.com/JeremyLikness)