Skip to content

breeze-client / ModelLibraryAdapter

Interface: ModelLibraryAdapter ​

Defined in: src/config/interface-registry.ts:89

Adapts breeze change-tracking to the UI framework

Extends ​

Properties ​

checkForRecomposition? ​

optional checkForRecomposition?: (context) => void

Defined in: src/config/config.ts:96

Optional. Called each time any adapter is initialized after this one first was, with { interfaceName, instance, isDefault }, so that this adapter can pick up a new dependency. The data service adapters use it to re-resolve their ajax adapter when a new default ajax adapter is initialized.

Parameters ​

context ​

any

Returns ​

void

Inherited from ​

BaseAdapter.checkForRecomposition


createCtor? ​

optional createCtor?: Function

Defined in: src/config/interface-registry.ts:102

Optional. Called with the EntityType or ComplexType to create a constructor for a type that has none registered. Without it, Breeze creates an empty constructor.


getTrackablePropertyNames ​

getTrackablePropertyNames: (entity) => string[]

Defined in: src/config/interface-registry.ts:91

Returns the names of the properties on an instance of an entity or complex type that the model library would track. Breeze calls it on a new instance of the type's constructor when it prepares the constructor, and adds any names the metadata does not know as unmapped properties.

Parameters ​

entity ​

any

Returns ​

string[]


name ​

name: string

Defined in: src/config/config.ts:84

The name the adapter is registered under, such as 'webApi' or 'backingStore'. Names are matched without regard to case. registerAdapter reads it from a throwaway instance and throws if it is empty.

Inherited from ​

BaseAdapter.name

Methods ​

initialize() ​

initialize(): void

Defined in: src/config/config.ts:90

Called by Breeze each time the adapter is initialized: when it is first created, and again whenever it is initialized by name or registered again, for example by configureBreeze. Resolve anything the adapter depends on here, not in the constructor.

Returns ​

void

Inherited from ​

BaseAdapter.initialize


initializeEntityPrototype() ​

initializeEntityPrototype(proto): void

Defined in: src/config/interface-registry.ts:93

Prepares the prototype of an entity or complex type constructor for tracking - for the backing store, adding getProperty, setProperty and a property accessor for each mapped property. Called when Breeze first sets up a type's constructor, and again when a property is added to a type whose prototype has already been prepared.

Parameters ​

proto ​

Object

Returns ​

void


peekProperty()? ​

optional peekProperty(entity, propertyName): any

Defined in: src/config/interface-registry.ts:100

Optional. The stored value of a property, without creating anything that reading it would create - the backing store builds a collection navigation's array on first read. Breeze falls back to getProperty for an adapter that does not implement this, which simply means the array is created as it always was.

Parameters ​

entity ​

any

propertyName ​

string

Returns ​

any


startTracking() ​

startTracking(entity, entityCtor): void

Defined in: src/config/interface-registry.ts:95

Starts tracking one new entity or complex object - for the backing store, moving its initial values into the backing store and giving each unset property its default value. Called once per instance, when its EntityAspect or ComplexAspect is created. Despite the parameter's name, Breeze passes the constructor's prototype as the second argument.

Parameters ​

entity ​

any

entityCtor ​

Function

Returns ​

void

Released under the MIT License.