DirectorySubject
Constructor Summary
| Public Constructor | ||
| public |
constructor(directory: Directory, store: EntityStore) Create DirectorySubject |
|
Member Summary
| Public Members | ||
| public |
directory: * Attached Directory |
|
| public |
interface: * Reactive interface which contains mutations, computed values and evaluated state |
|
| public |
observable: * Observable, updated each time directory state is changed |
|
| Private Members | ||
| private |
_store: * Attached EntityStore |
|
| private |
_subscriptions: {} [model name][entity id] like structure of subscriptions |
|
Method Summary
| Public Methods | ||
| public |
|
|
| public |
isSubscriberOf(name: string, id: *): Boolean |
|
| public |
Mutate directory state |
|
| public |
Prepares to subscribe Will rewrite previous subscription |
|
| public |
unsubscribe(name: string, id: *) Unsubscribe from entity updates and delete subscription |
|
| public |
update() Force update observable |
|
| public |
Force update interface |
|
| Private Methods | ||
| private |
_applyComputed(item: Object) Insert computed values into item(reactive interface or evaluated state) |
|
| private |
_applyMutations(reactiveInterface: Object) Insert mutation functions into reactiveInteface |
|
| private |
Writes evaluated state into item from structure |
|
| private |
|
|
| private |
_mapObserverToSource(item: Object, structure: Object, stateProvider: Object) Define reactive getters and setters |
|
Public Constructors
public constructor(directory: Directory, store: EntityStore) source
Create DirectorySubject
Params:
| Name | Type | Attribute | Description |
| directory | Directory | ||
| store | EntityStore |
Public Members
public interface: * source
Reactive interface which contains mutations, computed values and evaluated state
Private Members
Public Methods
public asObject(relationDeepness: number): Object source
Params:
| Name | Type | Attribute | Description |
| relationDeepness | number | how deep to resolve relationships |
public isSubscriberOf(name: string, id: *): Boolean source
Params:
| Name | Type | Attribute | Description |
| name | string | model name |
|
| id | * | entity id |
public subscribe(name: stirng, id: *): Function source
Prepares to subscribe Will rewrite previous subscription
Params:
| Name | Type | Attribute | Description |
| name | stirng | model name |
|
| id | * | entity id |
public unsubscribe(name: string, id: *) source
Unsubscribe from entity updates and delete subscription
Params:
| Name | Type | Attribute | Description |
| name | string | model name |
|
| id | * | entity id |
Private Methods
private _applyComputed(item: Object) source
Insert computed values into item(reactive interface or evaluated state)
Params:
| Name | Type | Attribute | Description |
| item | Object |
private _applyMutations(reactiveInterface: Object) source
Insert mutation functions into reactiveInteface
Params:
| Name | Type | Attribute | Description |
| reactiveInterface | Object |