Skip to main content
Version: 0.17

Class: Source<QueryOptions, TransformOptions, QueryBuilder, TransformBuilder>

Base class for sources.

Type parameters​

NameType
QueryOptionsextends RequestOptions = RequestOptions
TransformOptionsextends RequestOptions = RequestOptions
QueryBuilderunknown
TransformBuilderunknown

Hierarchy​

  • Evented

  • Performer

    ↳ Source

Constructors​

constructor​

• new Source<QueryOptions, TransformOptions, QueryBuilder, TransformBuilder>(settings?)

Type parameters​

NameType
QueryOptionsextends RequestOptions = RequestOptions
TransformOptionsextends RequestOptions = RequestOptions
QueryBuilderunknown
TransformBuilderunknown

Parameters​

NameType
settingsSourceSettings<QueryOptions, TransformOptions, QueryBuilder, TransformBuilder>

Inherited from​

Evented.constructor

Defined in​

packages/@orbit/data/src/source.ts:77

Accessors​

activated​

• get activated(): Promise<void>

Returns​

Promise<void>

Defined in​

packages/@orbit/data/src/source.ts:224


bucket​

• get bucket(): undefined | Bucket<unknown>

Returns​

undefined | Bucket<unknown>

Defined in​

packages/@orbit/data/src/source.ts:130


defaultQueryOptions​

• get defaultQueryOptions(): undefined | DefaultRequestOptions<QueryOptions>

Returns​

undefined | DefaultRequestOptions<QueryOptions>

Defined in​

packages/@orbit/data/src/source.ts:154

• set defaultQueryOptions(options): void

Parameters​

NameType
optionsundefined | DefaultRequestOptions<QueryOptions>

Returns​

void

Defined in​

packages/@orbit/data/src/source.ts:158


defaultTransformOptions​

• get defaultTransformOptions(): undefined | DefaultRequestOptions<TransformOptions>

Returns​

undefined | DefaultRequestOptions<TransformOptions>

Defined in​

packages/@orbit/data/src/source.ts:164

• set defaultTransformOptions(options): void

Parameters​

NameType
optionsundefined | DefaultRequestOptions<TransformOptions>

Returns​

void

Defined in​

packages/@orbit/data/src/source.ts:170


name​

• get name(): undefined | string

Returns​

undefined | string

Defined in​

packages/@orbit/data/src/source.ts:126


queryBuilder​

• get queryBuilder(): undefined | QueryBuilder

Returns​

undefined | QueryBuilder

Defined in​

packages/@orbit/data/src/source.ts:146


requestQueue​

• get requestQueue(): TaskQueue<string, unknown, unknown, unknown>

Returns​

TaskQueue<string, unknown, unknown, unknown>

Defined in​

packages/@orbit/data/src/source.ts:138


syncQueue​

• get syncQueue(): TaskQueue<string, unknown, unknown, unknown>

Returns​

TaskQueue<string, unknown, unknown, unknown>

Defined in​

packages/@orbit/data/src/source.ts:142


transformBuilder​

• get transformBuilder(): undefined | TransformBuilder

Returns​

undefined | TransformBuilder

Defined in​

packages/@orbit/data/src/source.ts:150


transformLog​

• get transformLog(): Log

Returns​

Log

Defined in​

packages/@orbit/data/src/source.ts:134

Methods​

activate​

â–¸ activate(): Promise<void>

Returns​

Promise<void>

Defined in​

packages/@orbit/data/src/source.ts:231


deactivate​

â–¸ deactivate(): Promise<void>

Returns​

Promise<void>

Defined in​

packages/@orbit/data/src/source.ts:238


emit​

â–¸ emit(event, ...args): void

Parameters​

NameType
eventEvent
...argsunknown[]

Returns​

void

Inherited from​

Evented.emit

Defined in​

packages/@orbit/core/dist/modules/evented.d.ts:23


getQueryOptions​

â–¸ getQueryOptions(query, expression?): undefined | QueryOptions

Parameters​

NameType
queryQuery<QueryExpression>
expression?QueryExpression

Returns​

undefined | QueryOptions

Defined in​

packages/@orbit/data/src/source.ts:176


getTransformOptions​

â–¸ getTransformOptions(transform, operation?): undefined | TransformOptions

Parameters​

NameType
transformTransform<Operation>
operation?Operation

Returns​

undefined | TransformOptions

Defined in​

packages/@orbit/data/src/source.ts:190


listeners​

â–¸ listeners(event): Listener[]

Parameters​

NameType
eventEvent

Returns​

Listener[]

Inherited from​

Evented.listeners

Defined in​

packages/@orbit/core/dist/modules/evented.d.ts:24


off​

â–¸ off(event, listener?): void

Parameters​

NameType
eventEvent
listener?Listener

Returns​

void

Inherited from​

Evented.off

Defined in​

packages/@orbit/core/dist/modules/evented.d.ts:21


on​

â–¸ on(event, listener): () => void

Parameters​

NameType
eventEvent
listenerListener

Returns​

fn

â–¸ (): void

Returns​

void

Inherited from​

Evented.on

Defined in​

packages/@orbit/core/dist/modules/evented.d.ts:20


one​

â–¸ one(event, listener): () => void

Parameters​

NameType
eventEvent
listenerListener

Returns​

fn

â–¸ (): void

Returns​

void

Inherited from​

Evented.one

Defined in​

packages/@orbit/core/dist/modules/evented.d.ts:22


perform​

â–¸ perform(task): Promise<unknown>

Parameters​

NameType
taskTask<string, unknown, unknown>

Returns​

Promise<unknown>

Inherited from​

Performer.perform

Defined in​

packages/@orbit/data/src/source.ts:205


transformed​

â–¸ transformed(transforms): Promise<void>

Notifies listeners that this source has been transformed by emitting the transform event.

Resolves when any promises returned to event listeners are resolved.

Also, adds an entry to the Source's transformLog for each transform.

Parameters​

NameType
transformsTransform<Operation>[]

Returns​

Promise<void>

Defined in​

packages/@orbit/data/src/source.ts:254


upgrade​

â–¸ upgrade(): Promise<void>

Upgrade source as part of a schema upgrade.

Returns​

Promise<void>

Defined in​

packages/@orbit/data/src/source.ts:220