matthewp / corset

Declarative data bindings, bring your own backend.

Home Page:https://corset.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New mount api

matthewp opened this issue · comments

Just something I've been thinking about:

import sheet, { mount } from 'https://cdn.corset.dev/0.4.0/main.js';

mount(document, class {
  constructor() {
    this.count = 0;
  }

  bind() {
    let { count } = this;
    return sheet`
      .counter {
        text: ${count};
      }
    `;
  }
});

More verbose but also simpler. TBD

Closed by #75