Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/artemavramenko/propjet.js
Reactive properties for JavaScript and TypeScript
https://github.com/artemavramenko/propjet.js
reactive-programming typescript
Last synced: 29 days ago
JSON representation
Reactive properties for JavaScript and TypeScript
- Host: GitHub
- URL: https://github.com/artemavramenko/propjet.js
- Owner: ArtemAvramenko
- License: mit
- Created: 2015-03-10T20:52:35.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-06-07T10:06:32.000Z (over 6 years ago)
- Last Synced: 2024-12-02T13:19:09.656Z (about 1 month ago)
- Topics: reactive-programming, typescript
- Language: JavaScript
- Homepage:
- Size: 1.94 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# propjet.js
JavaScript/TypeScript library for declaring reactive properties.Supports function mode for outdated browsers (IE8 and below).
Code licensed under [MIT License](LICENSE).
# Installing
* Via [NuGet](https://www.nuget.org/packages/propjet.js/): `$ Install-Package propjet.js`
* Via [Bower](http://bower.io/): `$ bower install propjet.js`
* Manually: extract files from [PropjetJS.zip](PropjetJS.zip?raw=true)# Example
```TypeScript
class Person
{
constructor()
{
propjet(this);
}firstName = propjet()
.default(() => "Unknown")
.declare();lastName = "";
fullName = propjet()
.require(() => this.firstName, () => this.lastName)
.get((firstName, lastName) => (firstName + " " + lastName).trim())
.declare();propIE8 = propjet()
.default(() => "Hello, IE!")
.declare(true); // function mode: get - propIE8(), set - propIE8(newValue)
}
```
more - [documentation](../../wiki/Documentation), [AngularJS demo](demo.ts), [Jasmine specs](src/propjet.spec.ts)