Store
The store handles changes and distributes actions to the storage drivers.
Constructor Summary
Public Constructor | ||
public |
constructor(projectStrategy: ProjectStrategy, distributor: Distributor) Create a new store instance. |
Member Summary
Protected Members | ||
protected |
A composite class that passes calls along to all storage drivers |
|
protected |
Cached version of the project collection |
|
protected |
Storage for project data |
Method Summary
Public Methods | ||
public |
applyChange(change: Change): Promise Apply a change to the store |
|
public |
applyChanges(changes: Changes): Promise Apply multiple changes to the store |
|
public |
Remove an item |
|
public |
Retrieve all projects at all versions |
|
public |
Store an item |
Protected Methods | ||
protected |
Retrieve a project collection, reused once loaded (singleton) |
|
protected |
removeProject(projectId: String): Promise Remove a project |
|
protected |
tagProject(projectId: String): Promise Tag a project |
Public Constructors
public constructor(projectStrategy: ProjectStrategy, distributor: Distributor) source
Create a new store instance.
Params:
Name | Type | Attribute | Description |
projectStrategy | ProjectStrategy | Storage for project data |
|
distributor | Distributor | A composite class that passes calls along to all storage drivers |
Protected Members
protected distributor: Distributor source
A composite class that passes calls along to all storage drivers
Public Methods
public applyChange(change: Change): Promise source
Apply a change to the store
Params:
Name | Type | Attribute | Description |
change | Change |
public applyChanges(changes: Changes): Promise source
Apply multiple changes to the store
Params:
Name | Type | Attribute | Description |
changes | Changes | Array of changes |
public putItem(projectId: String, schemaId: String, item: Item, projectVersion: Number): Promise source
Store an item
Protected Methods
protected getProjectCollection(): ProjectCollection source
Retrieve a project collection, reused once loaded (singleton)