Skip to content

MrAntix/bind

Repository files navigation

@ntix/bind

A small dom binder

Build CodeQL npm version

Documentation and working example

example

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

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

  const context = {
    text: 'click me',
    onClick: e => {

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

  bind(document, context);
</script>