@ntix/bind

A small dom binder

github.com/MrAntix/bind

example

The button innerText property and click event are bound to a context as shown below, click the button to see it in action

<button bind [inner-text]="data.text" {click}="onClick"></button>

<script type="module">
import { bind } from './bind.js';

const context = {
text: 'click me',
onClick: e => {
e.stopPropagation();

context.data.text = 'thanks!';
setTimeout(() => {
context.data.text = 'click me again';
}, 2000);
}
};

bind(document, context);
</script>