https://github.com/carlos-benedetti/stuckjs
two-way data binding in base js
https://github.com/carlos-benedetti/stuckjs
dom javascript two-way-data-binding
Last synced: about 2 months ago
JSON representation
two-way data binding in base js
- Host: GitHub
- URL: https://github.com/carlos-benedetti/stuckjs
- Owner: Carlos-Benedetti
- License: mit
- Created: 2019-12-13T10:36:04.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-13T10:36:21.000Z (over 5 years ago)
- Last Synced: 2025-02-16T03:19:50.146Z (3 months ago)
- Topics: dom, javascript, two-way-data-binding
- Language: JavaScript
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# stukJs- Simplified two-way data bind for JS
[](https://nodei.co/npm/stukjs/)
## Installation
### npm:
```shell
$ npm i stukjs --save
```
### browser:
```html```
## Usage
Pass an object containing all the variables that will be used by the page to `stuk.bindpage()`, and then add the `stuk` attribute to elements that should bind to a variable. The value passed to the `stuk` attribute should be an existing key in the object passed to `stuk.bindpage()`.
Changes to the bound variable's value will be reflected in the page, and changes made to the bound element's value will also propagate back to the script.## Example
```html
Stuk.bindPage({name:"Benedetti"});
```
### Notes
this code was based on: [wintellect](https://www.wintellect.com/data-binding-pure-javascript/).