ModelCollection
API > [PersistentModel Module] > ModelCollection
Class
In @besync/GraphStore, Collections are simply lists of related documents. The documents may be related on the basis of actually beings stored in the same collection (or table) on the same backend database, or may be the result of an observable query based on navigating the object graph or joining one or more database tables.
Implements
Constructors
Accessors
Methods
Constructors
any
, keys: any
, path: string
, graphStore: IGraphStore): ModelCollection
⊕ new ModelCollection(modelType: Defined in PersistentModel.ts:245
Constructor, usually called internally by @besync/GraphStore
Parameters:
Param | Type | Description |
---|---|---|
modelType | any | the constructor function to use when creating new documents in the collection |
keys | any | A key:value dictionary representing the common subset of primary keys for this collection |
path | string | A string representing the database access path to the location of the collection |
graphStore | IGraphStore | The persistent store where this collection exists |
Returns: ModelCollection
Accessors
observable
getobservable(): IEnhancedObservableArrayany
Defined in PersistentModel.ts:287
Returns the observable MobX array that represents the data in this collection
Returns: IEnhancedObservableArrayany
the MobX observable array
Methods
addObserver
► addObserver(): void
Implementation of IEnhancedObservableDelegate.addObserver
Defined in PersistentModel.ts:296
IEnhancedObservableDelegate.addObserver
Used internally by @besync/GraphStore to indicate when the first new observer is watching this collection
Returns: void
releaseObserver
► releaseObserver(): void
Implementation of IEnhancedObservableDelegate.releaseObserver
Defined in PersistentModel.ts:305
IEnhancedObservableDelegate.releaseObserver
Used internally by @besync/GraphStore to indicate when no more observers are watching this collection
Returns: void