<!-- // Code generated by coz. DO NOT EDIT. -->
# the-resource-base@1.4.9

Base of the-resource

+ Functions
  + [create(args)](#the-resource-base-function-create)
  + [isResourceClass(Class)](#the-resource-base-function-is-resource-class)
  + [listenMix(Class)](#the-resource-base-function-listen-mix)
  + [listenToCreate(onCreate)](#the-resource-base-function-listen-to-create)
  + [listenToDestroy(onDestroy)](#the-resource-base-function-listen-to-destroy)
  + [listenToDrop(onDrop)](#the-resource-base-function-listen-to-drop)
  + [listenToUpdate(onUpdate)](#the-resource-base-function-listen-to-update)
  + [queueMix(Class)](#the-resource-base-function-queue-mix)
  + [writeOnceMix(Class)](#the-resource-base-function-write-once-mix)
+ [`TheResource`](#the-resource-base-classes) Class
  + [new TheResource()](#the-resource-base-classes-the-resource-constructor)
  + [resource.refOf(id)](#the-resource-base-classes-the-resource-refOf)
  + [resource.emptyList()](#the-resource-base-classes-the-resource-emptyList)
  + [resource.invalidated(attributes)](#the-resource-base-classes-the-resource-invalidated)
  + [resource.refresh(entity)](#the-resource-base-classes-the-resource-refresh)
  + [resource.refreshAll()](#the-resource-base-classes-the-resource-refreshAll)
  + [resource.resaveAll()](#the-resource-base-classes-the-resource-resaveAll)

## Functions

<a class='md-heading-link' name="the-resource-base-function-create" ></a>

### create(args) -> `TheResource`

Create a TheResource instance

| Param | Type | Description |
| ----- | --- | -------- |
| args | * |  |

<a class='md-heading-link' name="the-resource-base-function-is-resource-class" ></a>

### isResourceClass(Class)

Detect is a resource class

| Param | Type | Description |
| ----- | --- | -------- |
| Class |  |  |

<a class='md-heading-link' name="the-resource-base-function-listen-mix" ></a>

### listenMix(Class) -> `function`

Mixins for listen

| Param | Type | Description |
| ----- | --- | -------- |
| Class | function |  |

<a class='md-heading-link' name="the-resource-base-function-listen-to-create" ></a>

### listenToCreate(onCreate) -> `function`

Listen to create

| Param | Type | Description |
| ----- | --- | -------- |
| onCreate | function |  |

<a class='md-heading-link' name="the-resource-base-function-listen-to-destroy" ></a>

### listenToDestroy(onDestroy) -> `function`

Listen to destroy

| Param | Type | Description |
| ----- | --- | -------- |
| onDestroy | function |  |

<a class='md-heading-link' name="the-resource-base-function-listen-to-drop" ></a>

### listenToDrop(onDrop) -> `function`

Listen to drop

| Param | Type | Description |
| ----- | --- | -------- |
| onDrop | function |  |

<a class='md-heading-link' name="the-resource-base-function-listen-to-update" ></a>

### listenToUpdate(onUpdate) -> `function`

Listen to update

| Param | Type | Description |
| ----- | --- | -------- |
| onUpdate | function |  |

<a class='md-heading-link' name="the-resource-base-function-queue-mix" ></a>

### queueMix(Class) -> `function`

Mixin for queue

| Param | Type | Description |
| ----- | --- | -------- |
| Class | function |  |

<a class='md-heading-link' name="the-resource-base-function-write-once-mix" ></a>

### writeOnceMix(Class) -> `function`

Mixin for writeOnce

| Param | Type | Description |
| ----- | --- | -------- |
| Class | function |  |



<a class='md-heading-link' name="the-resource-base-classes"></a>

## `TheResource` Class

Resource for the DB

**Extends**: 

+ `ClayResource`


+ `ListenMixed`



<a class='md-heading-link' name="the-resource-base-classes-the-resource-constructor" ></a>

### new TheResource()

Constructor of TheResource class



<a class='md-heading-link' name="the-resource-base-classes-the-resource-refOf" ></a>

### resource.refOf(id) -> `string,Object`

Get ref of id

| Param | Type | Description |
| ----- | --- | -------- |
| id |  | Id (or may be an entity) |


<a class='md-heading-link' name="the-resource-base-classes-the-resource-emptyList" ></a>

### resource.emptyList() -> `Promise.<lib.Collection>`

Create empty list

<a class='md-heading-link' name="the-resource-base-classes-the-resource-invalidated" ></a>

### resource.invalidated(attributes) -> `Promise.<Object>`

Get invalidated attributes

| Param | Type | Description |
| ----- | --- | -------- |
| attributes | Object |  |


<a class='md-heading-link' name="the-resource-base-classes-the-resource-refresh" ></a>

### resource.refresh(entity) -> `Promise.<void>`

Refresh clay entity

| Param | Type | Description |
| ----- | --- | -------- |
| entity | Entity |  |


<a class='md-heading-link' name="the-resource-base-classes-the-resource-refreshAll" ></a>

### resource.refreshAll() -> `Promise.<void>`

Refresh all

<a class='md-heading-link' name="the-resource-base-classes-the-resource-resaveAll" ></a>

### resource.resaveAll() -> `Promise.<void>`

Resave all



