# Class StaticDataSource<Data>

#### Type Parameters

- Data = any

#### Hierarchy (view full)

- BaseDataSource<Data, StaticDataSourceMetadata<Data>>
  - StaticDataSource

#### Implements

- OnDestroy

- Defined in packages/angular/data-source/src/lib/static.data-source.ts:43

#####
Index

### Constructors

constructor

### Properties

__id
_connectedViewer
_connectedViewerTeardown
_data?
_data$
_dataSubscription?
_initialised
_lastRefreshed
_retry$
_viewerIds
change$
destroyed$
error$
hasError?
hasError$
initialised$
interceptors
loading?
loading$
metadata
destroyed$
initialised$
instances

### Accessors

data
hasConnections
id
lastRefreshed

### Methods

_connect
_disconnect
applyMetadata
attach
connect
derive
destroy
disconnect
genericRetryFunction
getMetadata
getViewerId
handelError
init
isConnected
ngOnDestroy
refresh
reset
retry
toJSON
toPromise
add
remove

## Constructors

### constructor

- new StaticDataSource<Data>(data, metadata): StaticDataSource<Data>

- #### Type Parameters

  - Data = any

  #### Parameters

  - data: any
  - metadata: null | StaticDataSourceMetadata<any>

  #### Returns StaticDataSource<Data>

  Overrides BaseDataSource.constructor

  - Defined in packages/angular/data-source/src/lib/static.data-source.ts:49

## Properties

### `Internal` __id

__id: string = ...

unique internal id

Inherited from BaseDataSource.__id

- Defined in packages/angular/definition/src/lib/definition.ts:61

### `Protected` _connectedViewer

_connectedViewer: Map<string, Observable<Data>> = ...

Inherited from BaseDataSource._connectedViewer

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:78

### `Protected` _connectedViewerTeardown

_connectedViewerTeardown: Map<string, TeardownLogic> = ...

Inherited from BaseDataSource._connectedViewerTeardown

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:79

### `Protected` `Optional` _data

_data?: Data

Inherited from BaseDataSource._data

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:104

### `Protected` _data$

_data$: ReplaySubject<Data> = ...

Overrides BaseDataSource._data$

- Defined in packages/angular/data-source/src/lib/static.data-source.ts:46

### `Private` `Optional` _dataSubscription

_dataSubscription?: Subscription

- Defined in packages/angular/data-source/src/lib/static.data-source.ts:47

### `Protected` _initialised

_initialised: boolean = false

Inherited from BaseDataSource._initialised

- Defined in packages/angular/definition/src/lib/definition.ts:62

### `Protected` _lastRefreshed

_lastRefreshed: null | Date = null

Inherited from BaseDataSource._lastRefreshed

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:77

### `Protected` _retry$

_retry$: Subject<void> = ...

Inherited from BaseDataSource._retry$

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:90

### `Protected` _viewerIds

_viewerIds: Map<BaseDataSourceViewer<any>, string> = ...

a map of viewer to view id. Allows to create a view id from the viewer object reference

Inherited from BaseDataSource._viewerIds

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:89

### `Readonly` change$

change$: Subject<Data> = ...

Inherited from BaseDataSource.change$

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:67

### `Readonly` destroyed$

destroyed$: undefined | Subject<void> = ...

Emits if the data source is destroyed

Inherited from BaseDataSource.destroyed$

- Defined in packages/angular/definition/src/lib/definition.ts:48

### `Readonly` error$

error$: ReplaySubject<Error> = ...

Inherited from BaseDataSource.error$

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:73

### `Optional` hasError

hasError?: Signal<boolean>

Inherited from BaseDataSource.hasError

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:94

### `Readonly` hasError$

hasError$: ToggleSubject = ...

Inherited from BaseDataSource.hasError$

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:72

### `Readonly` initialised$

initialised$: undefined | Subject<void> = ...

Emits if the data source is initialised

Inherited from BaseDataSource.initialised$

- Defined in packages/angular/definition/src/lib/definition.ts:52

### `Readonly` interceptors

interceptors: undefined | Set<Subject<any>> = ...

Inherited from BaseDataSource.interceptors

- Defined in packages/angular/definition/src/lib/definition.ts:53

### `Optional` loading

loading?: Signal<boolean>

Inherited from BaseDataSource.loading

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:92

### loading$

loading$: Observable<boolean> = EMPTY

Indicates weather the data source is currently loading new data

Inherited from BaseDataSource.loading$

- Defined in packages/angular/data-source/src/lib/base.data-source.ts:71

### metadata

metadata: StaticDataSourceMetadata<Data>

Inherited from BaseDataSource.metadata

- Defined in packages/angular/definition/src/lib/definition.ts:44

### `Static` `Readonly` destroyed$

destroyed$: Subject<BaseDefinition<BaseDefinitionMetadata>> = ...

Emits when a new Definition instance is initialised

Inherited from BaseDataSource.destroyed$

- Defined in packages/angular/definition/src/lib/definition.ts:41

### `Static` `Readonly` initialised$

initialised$: Subject<BaseDefinition<BaseDefinitionMetadata>> = ...

Emits when a new Definition instance is initialised

Inherited from BaseDataSource.initialised$

- Defined in packages/angular/definition/src/lib/definition.ts:35

### `Static` `Readonly` instances

instances: Map<string, BaseDefinition<BaseDefinitionMetadata>> = ...

A map of active Definition instances

Inherited from BaseDataSource.instances

- Defined in packages/angular/definition/src/lib/definition.ts:27

## Accessors

### data

- get data(): Data

- #### Returns Data

  Overrides BaseDataSource.data

  - Defined in packages/angular/data-source/src/lib/static.data-source.ts:90
- set data(value): void

- #### Parameters

  - value: Data

  #### Returns void

  Overrides BaseDataSource.data

  - Defined in packages/angular/data-source/src/lib/static.data-source.ts:94

### hasConnections

- get hasConnections(): boolean

- #### Returns boolean

  Inherited from BaseDataSource.hasConnections

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:110

### id

- get id(): string

- #### Returns string

  Inherited from BaseDataSource.id

  - Defined in packages/angular/definition/src/lib/definition.ts:87

### lastRefreshed

- get lastRefreshed(): null | Date

- #### Returns null | Date

  Inherited from BaseDataSource.lastRefreshed

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:74

## Methods

### `Protected` _connect

- _connect(): Observable<Data>

- #### Returns Observable<Data>

  Overrides BaseDataSource._connect

  - Defined in packages/angular/data-source/src/lib/static.data-source.ts:105

### `Protected` _disconnect

- _disconnect(viewerId): void

- #### Parameters

  - viewerId: string

  #### Returns void

  Inherited from BaseDataSource._disconnect

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:308

### applyMetadata

- applyMetadata(partialMetadata): void

- #### Parameters

  - partialMetadata: Partial<StaticDataSourceMetadata<Data>>

  #### Returns void

  Inherited from BaseDataSource.applyMetadata

  - Defined in packages/angular/definition/src/lib/definition.ts:111

### attach

- attach(viewerId): Observable<Data>

- #### Parameters

  - viewerId: string

  #### Returns Observable<Data>

  Inherited from BaseDataSource.attach

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:210

### connect

- connect(viewerOrString): Observable<Data>

- #### Parameters

  - viewerOrString: string | BaseDataSourceViewer<any>

  #### Returns Observable<Data>

  Inherited from BaseDataSource.connect

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:124

### derive

- derive(id, metadata?): BaseDataSource<any, BaseDataSourceMetadata, BaseDataSourceViewer<any>>

- #### Parameters

  - id: string
  - metadata: Partial<BaseDataSourceMetadata> = ...

  #### Returns BaseDataSource<any, BaseDataSourceMetadata, BaseDataSourceViewer<any>>

  Inherited from BaseDataSource.derive

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:270

### destroy

- destroy(): void

- #### Returns void

  #### Deprecated

  use ngOnDestroy instead

  Inherited from BaseDataSource.destroy

  - Defined in packages/angular/definition/src/lib/definition.ts:118

### disconnect

- disconnect(viewerOrId): void

- #### Parameters

  - viewerOrId: string | BaseDataSourceViewer<any>

  #### Returns void

  Inherited from BaseDataSource.disconnect

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:225

### `Protected` genericRetryFunction

- genericRetryFunction(error, retryCount): Observable<any>

- #### Parameters

  - error: any
  - retryCount: number

  #### Returns Observable<any>

  Inherited from BaseDataSource.genericRetryFunction

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:311

### getMetadata

- getMetadata(): null | StaticDataSourceMetadata<Data>

- #### Returns null | StaticDataSourceMetadata<Data>

  Inherited from BaseDataSource.getMetadata

  - Defined in packages/angular/definition/src/lib/definition.ts:107

### getViewerId

- getViewerId(viewer): string

- #### Parameters

  - viewer: BaseDataSourceViewer<any>

  #### Returns string

  Inherited from BaseDataSource.getViewerId

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:114

### `Protected` handelError

- handelError(error): void

- #### Parameters

  - error: any

  #### Returns void

  Inherited from BaseDataSource.handelError

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:317

### init

- init(): void

- #### Returns void

  Inherited from BaseDataSource.init

  - Defined in packages/angular/definition/src/lib/definition.ts:127

### isConnected

- isConnected(viewerOrId): boolean

- #### Parameters

  - viewerOrId: string | BaseDataSourceViewer<any>

  #### Returns boolean

  Inherited from BaseDataSource.isConnected

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:217

### ngOnDestroy

- ngOnDestroy(): void

- #### Returns void

  Implementation of OnDestroy.ngOnDestroy

  Overrides BaseDataSource.ngOnDestroy

  - Defined in packages/angular/data-source/src/lib/static.data-source.ts:100

### refresh

- refresh(): any

- #### Returns any

  Inherited from BaseDataSource.refresh

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:290

### reset

- reset(): any

- #### Returns any

  Inherited from BaseDataSource.reset

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:297

### retry

- retry(): any

- #### Returns any

  Inherited from BaseDataSource.retry

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:293

### toJSON

- toJSON(): object

- #### Returns object

  Inherited from BaseDataSource.toJSON

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:280

### toPromise

- toPromise(viewer): Promise<Data>

- Creates a connection to tha data source and converts the Observable into a promise and then disconnects the viewer

  #### Parameters

  - viewer: BaseDataSourceViewer<any>

  #### Returns Promise<Data>

  Inherited from BaseDataSource.toPromise

  - Defined in packages/angular/data-source/src/lib/base.data-source.ts:264

### `Static` add

- add(definition): void

- #### Parameters

  - definition: BaseDefinition<BaseDefinitionMetadata>

  #### Returns void

  Inherited from BaseDataSource.add

  - Defined in packages/angular/definition/src/lib/definition.ts:94

### `Static` remove

- remove(definition): void

- #### Parameters

  - definition: BaseDefinition<BaseDefinitionMetadata>

  #### Returns void

  Inherited from BaseDataSource.remove

  - Defined in packages/angular/definition/src/lib/definition.ts:102