Skip to main content

foundation-comms.datasource

Home > @genesislcap/foundation-comms > Datasource

Datasource interface

Datasource interface.

Signature:

export interface Datasource extends DatasourceMetadata 

Extends: DatasourceMetadata

Remarks

The public interface available on the injected store fragment.

Properties

Property

Modifiers

Type

Description

dataserverOnlyParams

DataserverParams

Returns the datasource parameters that are only relevant for the data server.

initialized

boolean

Indicates whether the datasource has been initialized.

readOnly

boolean

Indicates whether the datasource is read-only. TODO: Should have is prefix

requestOnlyParams

RequestParams

Returns the request-only parameters for the datasource.

resourceType

ResourceType

The type of resource the datasource represents.

status

Partial<DatasourceStatus>

stream

SocketObservable<FilteredDataServerResult | RequestServerResult>

A stream of data from the datasource.

Methods

Method

Description

addView(view)?

(Optional) Adds the specified dataview to the datasource.

clearFilter(name)?

(Optional) Clears the filter with the specified name from the datasource.

createItem(data)?

(Optional) Creates a new item in the datasource with the specified data.

dataHandler(data)?

(Optional) Handles the specified data and returns it.

deleteItem(itemId)?

(Optional) Deletes an item with the given ID from the datasource.

destroy()

Destroys the datasource.

dropView(view)?

(Optional) Removes the specified dataview from the datasource.

getMetadata(resourceName)?

(Optional) Fetches metadata for the specified resource name.

init(options, fetchMeta, startStream)

Initializes the datasource with the given options and fetches metadata if specified.

setFilter(name, value, type)?

(Optional) Sets a filter on the datasource with the specified name, value, and type.

snapshot(overrideParams)

Takes a snapshot of the data in the datasource.

snapshotFiltered(rowId)

Takes a filtered snapshot of the data in the datasource.

startStream()

Starts the data stream for the datasource.

updateData(data)?

(Optional) Updates the data in the datasource with the specified data.

updateItem(itemId, data)?

(Optional) Updates an item in the datasource with the given ID and data.

updateLoadMoreCount(count)

Updates the load more (how many times user manually requested more data) count for the datasource.

validResourceName(resourceName)

Indicates whether the resourceName is valid or not.