keet
Version:
Minimalist view layer for the web
111 lines (80 loc) • 3.26 kB
Markdown
---
id: api_keet
title: keet
sidebar_label: keet
---
**Example**
```js
import Keet from 'keet'
class App extends Keet {
contructor() {
super()
// props
}
// new extended method
myMethod(...args){
//
}
}
const app = new App()
```
* [keet](
* [~Keet](
* [new Keet(localize)](
* [.mount(instance)](
* [.cycleVirtualDomTree(stub)](
* [.callBatchPoolUpdate()](
* [.subscribe(fn)](
* [.inform(...value)](
* [.storeRef(name)](
<a name="module_keet..Keet"></a>
| Param | Type | Description |
| --- | --- | --- |
| localize | <code>Boolean</code> | Use local inhertance for sub-components instead using global referance |
<a name="module_keet..Keet+mount"></a>
Mount an instance of html/string template
**Kind**: instance method of [<code>Keet</code>](
| Param | Type | Description |
| --- | --- | --- |
| instance | <code>Object</code> <code>string</code> | the html/string template |
<a name="module_keet..Keet+cycleVirtualDomTree"></a>
Parse this component to the DOM
**Kind**: instance method of [<code>Keet</code>](
| Param | Type | Description |
| --- | --- | --- |
| stub | <code>Boolean</code> | set as true if this a child component |
<a name="module_keet..Keet+callBatchPoolUpdate"></a>
Recheck all states if anything changed, diffing will occurs.
this method is ***asynchronous*** and ***trottled***, you can call it from a loop and
only trigger diffing when the loop end
**Kind**: instance method of [<code>Keet</code>](
<a name="module_keet..Keet+subscribe"></a>
Another component can subscribe to changes on this component.
This is the subscribe method
**Kind**: instance method of [<code>Keet</code>](
| Param | Type | Description |
| --- | --- | --- |
| fn | <code>function</code> | the callback function for the subscribe |
<a name="module_keet..Keet+inform"></a>
Another component can subscribe to changes on this component.
This is the publish method
**Kind**: instance method of [<code>Keet</code>](
| Param | Type | Description |
| --- | --- | --- |
| ...value | <code>\*</code> | one or more parameters to publish to subscribers |
<a name="module_keet..Keet+storeRef"></a>
Store referance in the global space, with this the parent component do need
to store/assign it as a property while still be able to look for the sub-component
to initialize it
**Kind**: instance method of [<code>Keet</code>](
| Param | Type | Description |
| --- | --- | --- |
| name | <code>string</code> | Identifier for the component, should be unique to avoid conflict |