Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 1.34 KB

README.md

File metadata and controls

42 lines (34 loc) · 1.34 KB

obnano

npm version Codacy Badge Codacy Badge Build Status

obnano = tagged template literal view (lit-html like library) + proxied observable state tree (mobx-state-tree like library) + html5 pushState router

npm install --save obnano

import { app, Store, autorun, html, ob } from "obnano";

const header = html`<div>Header markup here...</div>`;
const footer = html`<div>Footer markup here...</div>`;

const layout = store => html`
  ${header}
  <div>
    ${ob(() => store.count)}
  </div>
  <div>
    <button onclick=${store.increment} />
  </div>
  ${footer}
`;

app(Store(
  { 
    count: 0
  }, 
  { 
    increment(ctx) {
      ctx.count += 1;
    }
  }
), layout);

License

obnano is MIT licensed. See LICENSE.