<commit_before>lit-mobx
========

Mixins that allow easy usage of mobx observables with lit-element.


<commit_msg>Adds usage to readme<commit_after>lit-mobx
========

Mixins that allow easy usage of mobx observables with lit-element.

## Installation
```
npm install
```

## Demo
```
npm run demo
```

## Usage

```typescript
import { LitElement, html, property, TemplateResult, customElement } from 'lit-element';
import { observable, action } from 'mobx';
import { ObserveRender } from 'lit-mobx';

// create a mobx observable 
class Counter {
    @observable
    public count = 0;

    @action
    public increment() {
        this.count++;
    }
}

// create a new custom element, and use the ObserveRender mixin
@customElement('my-element')
export class MyElement extends ObserveRender(LitElement) {
    @property({ type: Object })
    private counter = new Counter();

    // any observables accessed in the render method will now trigger an update
    public render(): TemplateResult {
        return html`
            Count is ${this.counter.count}<br/>
            <button @click=${this.incrementCount}>Add</button>
        `;
    }

    private incrementCount() {
        this.counter.increment();
    }
}
```
{'fraction_non_alphanumeric': 0.12377049180327869, 'fraction_numerical': 0.000819672131147541, 'mean_word_length': 3.254355400696864, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1607724', 'n_tokens_mistral': 366, 'n_tokens_neox': 339, 'n_words': 113}